Move and consolidate many third-party plugin files and metadata from various locations (notably Assets/Third Parties/Plugins 1 and scattered Opsive/Photon folders) into a unified Assets/Plugins directory. Includes DOTween, PrimeTween, Native/BackroomsNoise, Sirenix/Odin Inspector, and Opsive UltimateCharacterController/shared libs, plus updates to several .meta files and removal of obsolete installer/legacy files. This standardizes plugin layout and cleans up duplicate/obsolete assets.
90 lines
3.2 KiB
C#
90 lines
3.2 KiB
C#
/// ---------------------------------------------
|
|
/// Ultimate Character Controller
|
|
/// Copyright (c) Opsive. All Rights Reserved.
|
|
/// https://www.opsive.com
|
|
/// ---------------------------------------------
|
|
|
|
namespace Opsive.UltimateCharacterController.Input
|
|
{
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// Uses Unity's input system to detect input related actions.
|
|
/// </summary>
|
|
public class StandaloneInput : InputBase
|
|
{
|
|
/// <summary>
|
|
/// Returns if the button is true with the specified ButtonAction.
|
|
/// </summary>
|
|
/// <param name="name">The name of the button.</param>
|
|
/// <param name="action">The type of action to check.</param>
|
|
/// <returns>The status of the action.</returns>
|
|
public override bool GetButton(string name, ButtonAction action)
|
|
{
|
|
#if UNITY_EDITOR
|
|
try {
|
|
switch (action) {
|
|
case ButtonAction.GetButton:
|
|
return UnityEngine.Input.GetButton(name);
|
|
case ButtonAction.GetButtonDown:
|
|
return UnityEngine.Input.GetButtonDown(name);
|
|
case ButtonAction.GetButtonUp:
|
|
return UnityEngine.Input.GetButtonUp(name);
|
|
}
|
|
}
|
|
catch (System.Exception /*e*/) {
|
|
Debug.LogError("Button \"" + name + "\" is not setup. Please create a button mapping within the Unity Input Manager.");
|
|
}
|
|
#else
|
|
switch (action) {
|
|
case ButtonAction.GetButton:
|
|
return UnityEngine.Input.GetButton(name);
|
|
case ButtonAction.GetButtonDown:
|
|
return UnityEngine.Input.GetButtonDown(name);
|
|
case ButtonAction.GetButtonUp:
|
|
return UnityEngine.Input.GetButtonUp(name);
|
|
}
|
|
#endif
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return the value of the axis with the specified name.
|
|
/// </summary>
|
|
/// <param name="name">The name of the axis.</param>
|
|
/// <returns>The value of the axis.</returns>
|
|
public override float GetAxis(string name)
|
|
{
|
|
#if UNITY_EDITOR
|
|
try {
|
|
return UnityEngine.Input.GetAxis(name);
|
|
}
|
|
catch (UnityException /*e*/) {
|
|
Debug.LogError("Axis \"" + name + "\" is not setup. Please create an axis mapping within the Unity Input Manager.");
|
|
}
|
|
return 0;
|
|
#else
|
|
return UnityEngine.Input.GetAxis(name);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return the value of theraw axis with the specified name.
|
|
/// </summary>
|
|
/// <param name="name">The name of the axis.</param>
|
|
/// <returns>The value of the raw axis.</returns>
|
|
public override float GetAxisRaw(string name)
|
|
{
|
|
#if UNITY_EDITOR
|
|
try {
|
|
return UnityEngine.Input.GetAxisRaw(name);
|
|
} catch (UnityException /*e*/) {
|
|
Debug.LogError("Axis \"" + name + "\" is not setup. Please create an axis mapping within the Unity Input Manager.");
|
|
}
|
|
return 0;
|
|
#else
|
|
return UnityEngine.Input.GetAxisRaw(name);
|
|
#endif
|
|
}
|
|
}
|
|
} |