-
-
Notifications
You must be signed in to change notification settings - Fork 0
IL_LayeredActionBase
Namespace: Lowry.UI.InputLayers
public abstract class IL_LayeredActionBase<T> : MonoBehaviour where T : LayeredActionFor use in the Inspector only.
A common abstract base class for all implementations of LayeredAction for inspector-based use.
This abstract class contains the core logic for exposing LayeredAction derived classes to the Unity Inspector.
By inheriting from this class, you can create custom components that manage different subsets of a LayeredAction, allowing them to be automatically enabled/disabled and having their associated IL_Layer activated/deactivated during Unity's lifecycle events (like Start and OnDestroy).
If you are just looking to use a standard action, you should use the IL_LayeredAction component.
protected abstract T __layeredAction { get; }Defines the InputAction🔗 that will trigger the events if the correct IL_Layer is active.
Must be implemented by derived classes to provide the specificLayeredActioninstance.
private bool _enableOnStart = true;If
true, the LayeredAction provided by __layeredAction will remain enabled when the object is loaded.
private bool _enableActionMapOnStart = true;If
true, the InputActionMap🔗 associated with __layeredAction will be enabled when the object is loaded.
private bool _enableInputActionOnStart = true;If
true, theInputActionpart of the __layeredAction will be enabled when the object is loaded.
protected bool _disableOnDestroy = true;If
true, the LayeredAction will be disabled when the object is destroyed.
protected bool _disableActionMapOnDestroy = false;If
true, the InputActionMap🔗 associated with the __layeredAction will be disabled when the object is destroyed.
protected bool _disableInputActionOnDestroy = false;If
true, theInputActionpart of the __layeredAction will be disabled when the object is destroyed.
private bool _activateLayerOnStart = true;If
true, the IL_Layer associated with __layeredAction will be activated when the object is loaded.
protected bool _deactivateLayerOnDestroy = true;If
true, the IL_Layer associated with __layeredAction will be deactivated when the object is destroyed.
public void Enable ()Calls EnableWithParameters() with default values of
enableActionMap = trueandenableInputAction = true.
public abstract void EnableWithParameters (bool enableActionMap, bool enableInputAction)Enables this script's LayeredAction and registers its events.
Inheriting classes must provide the specific implementation details for their registered actions.
public void Disable ()Calls DisableWithParameters() with default values of
disableActionMap = falseanddisableInputAction = false.
public abstract void DisableWithParameters (bool disableActionMap, bool disableInputAction)Disables this script's LayeredAction and unregisters its events.
Inheriting classes must provide the specific implementation details for their registered actions.
public void DisableActionMap ()Disables the InputActionMap🔗 that __layeredAction belongs to.
public void ActivateLayer ()Activates the IL_Layer that __layeredAction belongs to.
public void DeactivateLayer ()Deactivates the IL_Layer that __layeredAction belongs to.
👉🏻 Download InputLayers on the Unity Asset Store!