forked from cgvr/DeltaVR
fix radio button flakiness
This commit is contained in:
@@ -33,19 +33,21 @@ public class ReleasableButton : MonoBehaviour
|
||||
|
||||
}
|
||||
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
private void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
if (!isButtonDown && collision.gameObject.tag.EndsWith("Hand"))
|
||||
if (!isButtonDown && collider.gameObject.tag.EndsWith("Hand"))
|
||||
{
|
||||
Debug.Log("collided with: " + collider.gameObject.name);
|
||||
Activate();
|
||||
OnButtonPressed?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCollisionExit(Collision collision)
|
||||
private void OnTriggerExit(Collider collider)
|
||||
{
|
||||
if (isButtonDown && collision.gameObject.tag.EndsWith("Hand"))
|
||||
if (isButtonDown && collider.gameObject.tag.EndsWith("Hand"))
|
||||
{
|
||||
Debug.Log("collider exited: " + collider.gameObject.name);
|
||||
Deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user