using UnityEngine.InputSystem; namespace UnityEngine.XR.Interaction.Toolkit.Inputs { /// /// Extension methods for . /// public static class InputActionPropertyExtensions { /// /// Enable the action held on to by the only if it represents /// an directly. In other words, function will do nothing if the action /// has a non- property. /// /// The property to operate on. /// /// This can make it easier to allow the enabled state of the serialized with /// a to be owned by the behavior itself, but let a reference type be managed /// elsewhere. /// public static void EnableDirectAction(this InputActionProperty property) { if (property.reference != null) return; property.action?.Enable(); } /// /// Disable the action held on to by the only if it represents /// an directly. In other words, function will do nothing if the action /// has a non- property. /// /// The property to operate on. /// /// This can make it easier to allow the enabled state of the serialized with /// a to be owned by the behavior itself, but let a reference type be managed /// elsewhere. /// public static void DisableDirectAction(this InputActionProperty property) { if (property.reference != null) return; property.action?.Disable(); } } }