Skip to content

IL_LayerToggle

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

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() or OnDestroy(), 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 (Start()).

_deactivateOnDestroy

private bool _deactivateOnDestroy = true;

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

📄Methods

Activate()

public void Activate ()

Tries to activate the _layer.

Note: The layer will only become active if there are no 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