27 lines
721 B
C#
27 lines
721 B
C#
|
|
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();
|
|
}
|
|
}
|
|
}
|