diff --git a/Assets/Scripts/Interactions/Filters/XRInteractableLockingFilter.cs b/Assets/Scripts/Interactions/Filters/XRInteractableLockingFilter.cs index 566222b..9b7aaa6 100644 --- a/Assets/Scripts/Interactions/Filters/XRInteractableLockingFilter.cs +++ b/Assets/Scripts/Interactions/Filters/XRInteractableLockingFilter.cs @@ -1,7 +1,8 @@ /// Traken from https://forum.unity.com/threads/how-to-prevent-interactable-from-being-selected-while-in-socket.1317246/#post-9101254 using UnityEngine.Assertions; - +using UnityEngine.Serialization; + namespace UnityEngine.XR.Interaction.Toolkit.Filtering { [DisallowMultipleComponent] @@ -13,14 +14,14 @@ namespace UnityEngine.XR.Interaction.Toolkit.Filtering [SerializeField] private XRBaseInteractable interactable; - [SerializeField] - private bool m_locked = false; + [FormerlySerializedAs("m_locked")] [SerializeField] + private bool isLocked = false; #endregion #region Properties - public bool locked { get => m_locked; set => m_locked = value; } + public bool IsLocked { get => isLocked; set => isLocked = value; } public bool canProcess => true; @@ -83,7 +84,7 @@ namespace UnityEngine.XR.Interaction.Toolkit.Filtering if (interactable == null) return false; - return !m_locked; + return !isLocked; } #endregion diff --git a/Assets/Scripts/Interactions/Filters/XRInteractorLockingFilter.cs b/Assets/Scripts/Interactions/Filters/XRInteractorLockingFilter.cs index f51fd20..74e9c8b 100644 --- a/Assets/Scripts/Interactions/Filters/XRInteractorLockingFilter.cs +++ b/Assets/Scripts/Interactions/Filters/XRInteractorLockingFilter.cs @@ -15,14 +15,14 @@ namespace UnityEngine.XR.Interaction.Toolkit.Filtering [SerializeField] private XRBaseInteractor interactor; - [FormerlySerializedAs("m_locked")] [SerializeField] - private bool locked = false; + [FormerlySerializedAs("locked")] [SerializeField] + private bool isLocked = false; #endregion #region Properties - public bool Locked { get => locked; set => locked = value; } + public bool IsLocked { get => isLocked; set => isLocked = value; } public bool canProcess => true; @@ -85,7 +85,7 @@ namespace UnityEngine.XR.Interaction.Toolkit.Filtering if (interactor == null) return false; - return !locked; + return !isLocked; } #endregion