using UnityEngine; namespace Core.Input { /// /// Base class for any input scheme that knows how and when to activate itself /// public abstract class InputScheme : MonoBehaviour { /// /// Gets whether the scheme should be activated or not /// public abstract bool shouldActivate { get; } /// /// Gets whether this scheme should be default /// public abstract bool isDefault { get; } /// /// Activate if not already activated /// /// /// The scheme that was previously enabled. /// Will be null on start up. /// public virtual void Activate(InputScheme previousScheme) { if (!enabled) { enabled = true; } } /// /// Deactivate if not already deactivated /// /// /// The next scheme that will be activated. /// Will be null on start up. /// public virtual void Deactivate(InputScheme nextScheme) { if (enabled) { enabled = false; } } } }