Skip to content

InputLayer

Eric Lowry edited this page Mar 5, 2026 · 4 revisions

Namespace: Lowry.UI.InputLayers

public struct InputLayer : IComparable, IComparable<InputLayer>, IEquatable<InputLayer>

Represents an IL_Layer with an advanced custom inspector.

💡General Information

This structure is mainly for internal use, and it is unlikely that you will need to work with it directly.

Its main goal is to expose a custom property drawer for the Unity Inspector that can point to any IL_Layer you have configured within the InputLayers editor window.

This is a core component of the LayeredAction system.

📄Fields

name

public string name;

The name of the IL_Layer this is meant to represent.
Since layer names must be unique, this serves as the actual reference to the underlying IL_Layer.

📄Properties

_layer

public readonly IL_Layer _layer { get {...} }

Returns a direct reference to the IL_Layer that this structure represents.

onActivated

public event Action onActivated { add {...} remove {...} }

The event that gets triggered when the _layer is activated.

onDeactivated

public event Action onDeactivated { add {...} remove {...} }

The event that gets triggered when the _layer is deactivated.

_priority

public readonly int? _priority { get {...} }

The id of the IL_PriorityLayer that this layer belongs to within IL_ScriptableRefs.r_priorities.
Is null if the layer does not belong to any IL_PriorityLayer.

_isActive

public readonly bool _isActive { get {...} }

true when this layer is currently the unique active layer.

Security: Will return false on the same frame as the layer was activated on.
Otherwise, an input could be used to activate a layer, and then be triggered on that same layer immediately.

_isActiveUnsafe

public readonly bool _isActiveUnsafe { get {...} }

true when this layer is currently the unique active layer, even when called on the same frame the layer was activated on.

_isEnabled

public readonly bool _isEnabled { get {...} }

true when this layer is enabled.
IMPORTANT: It may not be active.

📄Methods

Activate()

public readonly bool? Activate () {...}

Tries to activate the _layer.

Returns:

  • true when the layer has been activated (or was already active).
  • false when the layer has not been activated (it will still be added to the relevant stack).
  • null when the layer isn't present inside any of the IL_ScriptableRefs.r_priorities.

Deactivate()

public readonly void Deactivate () {...}

Deactivates the _layer.

📄Constructors

InputLayer(string)

public InputLayer (string name_) {...}

Sets the layer reference using a layer name string.

InputLayer(IL_Layer)

public InputLayer (IL_Layer layer) {...}

Sets the layer reference using a direct reference to an IL_Layer.

📒Notes

All the IComparable and IEquatable implementations are built by comparing name values as it is used as the reference to this structure's underlying IL_Layer.

Clone this wiki locally