forked from cgvr/DeltaVR
radio button is disabled before radio is grabbed
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Threading.Tasks;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
@@ -22,6 +23,7 @@ public class RadioTransmitter : XRGrabInteractable
|
||||
{
|
||||
radioButton.OnButtonPressed += OnRadioButtonPressed;
|
||||
radioButton.OnButtonReleased += OnRadioButtonReleased;
|
||||
radioButton.Lock();
|
||||
isProcessing = false;
|
||||
|
||||
var emission = particles.emission;
|
||||
@@ -34,10 +36,13 @@ public class RadioTransmitter : XRGrabInteractable
|
||||
particles.transform.LookAt(computerScreen.transform.position);
|
||||
}
|
||||
|
||||
protected override void OnSelectEntered(SelectEnterEventArgs args)
|
||||
protected async override void OnSelectEntered(SelectEnterEventArgs args)
|
||||
{
|
||||
base.OnSelectEntered(args);
|
||||
OnPlayerPickUp?.Invoke();
|
||||
|
||||
await Task.Delay(100);
|
||||
radioButton.Unlock();
|
||||
}
|
||||
|
||||
private void OnRadioButtonPressed()
|
||||
|
||||
Reference in New Issue
Block a user