Skip to content

LayeredUnityAction

Eric Lowry edited this page Jul 16, 2023 · 1 revision

Namespace: Lowry.UI.InputLayers

internal sealed class LayeredUnityAction : LayeredAction

Extends the LayeredAction class to trigger corresponding UnityEvents🔗 when its delegates are performed.

💡General Information

This class is used to make LayeredActions accessible in situations where UnityEvents🔗 are preferable to standard delegates.

The IL_LayeredAction script uses this methodology to ensure InputLayers can be used entirely within the Unity Inspector.

📄Events

onPerformedUnityEvent

public UnityEvent onPerformedUnityEvent;

Triggered when base._action gets Performed and base._layer is active.

onStartedUnityEvent

public UnityEvent onStartedUnityEvent;

Triggered when base._action gets Started and base._layer is active.

onCanceledUnityEvent

public UnityEvent onCanceledUnityEvent;

Triggered when base._action gets Canceled and base._layer is active.

📄Methods

ActionPerformed(InputAction.CallbackContext)

protected override void ActionPerformed(InputAction.CallbackContext context) {...}

Must be called as a result of base._action being Performed.

ActionStarted(InputAction.CallbackContext)

protected override void ActionStarted(InputAction.CallbackContext context) {...}

Must be called as a result of base._action being Started.

ActionCanceled(InputAction.CallbackContext)

protected override void ActionCanceled(InputAction.CallbackContext context) {...}

Must be called as a result of base._action being Canceled.