-
-
Notifications
You must be signed in to change notification settings - Fork 0
IL_LayeredAction
Namespace: Lowry.UI.InputLayers
public sealed class IL_LayeredAction : IL_LayeredActionBase<LayeredAction>Extends the IL_LayeredActionBase class, which it inherits most of its configuration and workflow logic from.
For use in the Inspector only.
Allows the use of LayeredActions in the Unity inspector.
This script is designed to expose a LayeredAction in the Unity Inspector.
It lets you assign a Unity InputAction🔗 to a specific IL_Layer, and then control both the layer and InputAction through configuring its fields in the inspector and by calling its public methods.
Along with the IL_LayerToggle script, it lets you make full use of InputLayers directly from within the Unity Editor interface.
protected override LayeredAction __layeredAction { get; }Overrides the base class property to provide the explicitly assigned _layeredAction to its inherited workflow methods.
private LayeredAction _layeredAction;Defines the InputAction🔗 that will trigger the _onEventTriggered IF the correct IL_Layer is active.
private ActionEventType _eventTypeUsed = ActionEventType.performed;Determines whether _onEventTriggered will trigger when the _layeredAction's onStartedEvent, onPerformedEvent or onCanceledEvent is called.
private UnityEvent _onEventTriggered;Will be triggered when _layeredAction's event corresponding to the value of _eventTypeUsed is called IF its corresponding IL_Layer is active.
(See IL_LayeredActionBase for the extensive list of inherited inspector configuration fields).
(See IL_LayeredActionBase for the documentation of inherited lifecycle methods, including Enable(), Disable(), ActivateLayer(), DisableActionMap() and more).
public override void EnableWithParameters (bool enableActionMap, bool enableInputAction)Enables this script's and registers the appropriate event based on .
Parameters:
- enableActionMap: If
true, the InputActionMap🔗 this action belongs to will be enabled.
The map will remain enabled as long as LayeredActions that belong to it are enabled.- enableInputAction: If
true, the action will be "manually" enabled.
public override void DisableWithParameters (bool disableActionMap, bool disableInputAction)Disables this script's and unregisters the appropriate event based on .
Parameters:
- disableActionMap: If
true, the InputActionMap🔗 this action belongs to will be disabled.
The map will remain enabled as long as LayeredActions that belong to it are enabled.- disableInputAction: If
true, the action will be "manually" disabled.
private void OnEventTriggered (CallbackContext context)Triggered when _layeredAction is triggered. This method is used as the listener for the internal
LayeredActionevents and invokes the _onEventTriggered UnityEvent.
public enum ActionEventType
{
started,
performed,
canceled
}Used to select the type of LayeredAction delegates this script should call the _onEventTriggered UnityEvent for in the inspector.
👉🏻 Download InputLayers on the Unity Asset Store!