Skip to content

IL_LayerToggle

Eric Lowry edited this page Aug 5, 2023 · 1 revision

Namespace: Lowry.UI.InputLayers

public sealed class IL_LayerToggle : MonoBehaviour

For use in the Inspector only.
Allows the use of InputLayers in the Unity inspector.

💡General Information

This script is designed to expose an InputLayer in the Unity Inspector.

It lets you Activate() or Deactivate() the layer either on Start/Destroy, or manually using UnityEvents🔗.

Along with the IL_LayeredAction script, it lets you make full use of InputLayers directly from within the Unity Editor interface.

📄Fields

_layer

private InputLayer _layer;

The IL_Layer that will be controllable through the inspector.

_activateOnStart

private bool _activateOnStart = true;

If true, the _layer will be activated when the object is loaded.

_deactivateOnDestroy

private bool _deactivateOnDestroy = true;

If true, the _layer will be deactivated when the object is destroyed.

📄Methods

Activate()

public void Activate ()

Tries to activate the _layer.

Note: The layer will only become active if there are active layers at a higher IL_PriorityLayer within the IL_ScriptableRefs.r_priorities list.

Deactivate()

public void Deactivate ()

Deactivates the _layer.

Clone this wiki locally