MAVRIC-2183: Updated locking boolean to be a little bit better

This commit is contained in:
Brown, Caleb M 2023-11-10 15:23:13 -05:00
parent f8ee8dcf35
commit 6569dad7b6
2 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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