Universally challenged added
This commit is contained in:
26
Assets/Quiz/Scripts/UC/Buzzer.cs
Normal file
26
Assets/Quiz/Scripts/UC/Buzzer.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
|
||||
public class Buzzer : UdonSharpBehaviour
|
||||
{
|
||||
public PlayerSeat playerSeat;
|
||||
public UniversallyChallengedManager ucManager;
|
||||
|
||||
public override void Interact()
|
||||
{
|
||||
if (!Networking.IsOwner(gameObject))
|
||||
{
|
||||
Networking.SetOwner(Networking.LocalPlayer, gameObject);
|
||||
}
|
||||
|
||||
if (playerSeat != null && ucManager != null && ucManager.isBuzzersEnabled)
|
||||
{
|
||||
playerSeat.SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, nameof(playerSeat.PlayBuzzerSound));
|
||||
ucManager.isBuzzersEnabled = false;
|
||||
ucManager.RequestSerialization();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user