/// ---------------------------------------------
/// Ultimate Character Controller
/// Copyright (c) Opsive. All Rights Reserved.
/// https://www.opsive.com
/// ---------------------------------------------
namespace Opsive.UltimateCharacterController.Input
{
///
/// The base class for both mobile and standalone (keyboard/mouse and controller) input. This base class exists so UnityInput doesn't need to know if it
/// is working with mobile controls or standalone controls.
///
public abstract class InputBase
{
///
/// The type of button action to check against.
///
public enum ButtonAction { GetButton, GetButtonDown, GetButtonUp }
protected PlayerInput m_PlayerInput;
///
/// Initializes the UnityInputBase.
///
/// A reference to the PlayerInput component.
public void Initialize(PlayerInput playerInput)
{
m_PlayerInput = playerInput;
}
///
/// Returns if the button is true with the specified ButtonAction.
///
/// The name of the button.
/// The type of action to check.
/// The status of the action.
public abstract bool GetButton(string name, ButtonAction action);
///
/// Returns the axis of the specified button.
///
/// The name of the axis.
/// The axis value.
public abstract float GetAxis(string name);
///
/// Returns the raw axis of the specified button.
///
/// The name of the axis.
/// The raw axis value.
public abstract float GetAxisRaw(string axisName);
}
}