Skip to content

IL_LayeredAction

Eric Lowry edited this page Feb 28, 2026 · 7 revisions

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.

💡General Information

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.

📄Properties

__layeredAction

protected override LayeredAction __layeredAction { get; }

Overrides the base class property to provide the explicitly assigned _layeredAction to its inherited workflow methods.

📄Fields

_layeredAction

private LayeredAction _layeredAction;

Defines the InputAction🔗 that will trigger the _onEventTriggered IF the correct IL_Layer is active.

_eventTypeUsed

private ActionEventType _eventTypeUsed = ActionEventType.performed;

Determines whether _onEventTriggered will trigger when the _layeredAction's onStartedEvent, onPerformedEvent or onCanceledEvent is called.

_onEventTriggered

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).

📄Methods

(See IL_LayeredActionBase for the documentation of inherited lifecycle methods, including Enable(), Disable(), ActivateLayer(), DisableActionMap() and more).

EnableWithParameters(bool, bool)

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.

DisableWithParameters(bool, bool)

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.

OnEventTriggered(CallbackContext)

private void OnEventTriggered (CallbackContext context)

Triggered when _layeredAction is triggered. This method is used as the listener for the internal LayeredAction events and invokes the _onEventTriggered UnityEvent.

📄Enums

ActionEventType

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.

Clone this wiki locally