/// ---------------------------------------------
/// Ultimate Character Controller
/// Copyright (c) Opsive. All Rights Reserved.
/// https://www.opsive.com
/// ---------------------------------------------
namespace Opsive.UltimateCharacterController.Input.VirtualControls
{
using UnityEngine;
///
/// An abstract class which represents a virtual control on the screen.
///
public abstract class VirtualControl : MonoBehaviour
{
protected VirtualControlsManager m_VirtualControlsManager;
///
/// Initialize the default values.
///
protected virtual void Awake()
{
m_VirtualControlsManager = GetComponentInParent();
if (m_VirtualControlsManager == null) {
Debug.LogError("Error: Unable to find the VirtualControlsManager. This component must be a parent to the virtual input monitors.");
}
}
///
/// Returns if the button is true with the specified ButtonAction.
///
/// The type of action to check.
/// The status of the action.
public virtual bool GetButton(InputBase.ButtonAction action) { return false; }
///
/// Returns the value of the axis.
///
/// The name of the axis.
/// The value of the axis.
public virtual float GetAxis(string name) { return 0; }
}
}