1
0
forked from cgvr/DeltaVR

improve fmod whisper bridge and radio button using it

This commit is contained in:
2026-02-21 20:25:12 +02:00
parent c968e6bed4
commit 1a29f785b8
4 changed files with 204 additions and 86 deletions

View File

@@ -5,6 +5,8 @@ public class ReleasableButton : MonoBehaviour
{
public delegate void OnButtonPressedDelegate();
public event OnButtonPressedDelegate OnButtonPressed;
public delegate void OnButtonReleasedDelegate();
public event OnButtonReleasedDelegate OnButtonReleased;
public Transform movableParts;
public float moveDuration = 0.25f;
@@ -37,7 +39,6 @@ public class ReleasableButton : MonoBehaviour
{
if (!isButtonDown && collider.gameObject.tag.EndsWith("Hand"))
{
Debug.Log("collided with: " + collider.gameObject.name);
Activate();
OnButtonPressed?.Invoke();
}
@@ -47,8 +48,8 @@ public class ReleasableButton : MonoBehaviour
{
if (isButtonDown && collider.gameObject.tag.EndsWith("Hand"))
{
Debug.Log("collider exited: " + collider.gameObject.name);
Deactivate();
OnButtonReleased?.Invoke();
}
}