Skip to content

InputLayer

Eric Lowry edited this page Jul 15, 2023 · 2 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 readonly Action onActivated { get {...} set {...} }

The event that gets triggered when the _layer is activated.

onDeactivated

public readonly Action onDeactivated { get {...} set {...} }

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.

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

Dectivate()

public readonly void Dectivate () {...}

Tries to deactivate 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.