- Buzzer model has been updated, and includes a trigger pull animation. - Lightning round intro sound is now music instead of a sound effect. - Fixed a bug that made the host card interactable on round start.
43 lines
871 B
C#
43 lines
871 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.SDK3.UdonNetworkCalling;
|
|
using VRC.Udon.Common.Interfaces;
|
|
using VRC.SDKBase;
|
|
using VRC.Udon;
|
|
|
|
public class Buzzer : UdonSharpBehaviour
|
|
{
|
|
[SerializeField] private PlayerPodium _Podium;
|
|
[SerializeField] private Animator _Animator;
|
|
|
|
private GameManagerRound1 _GameManager;
|
|
|
|
|
|
public void SetGameManager(GameManagerRound1 Manager)
|
|
{
|
|
_GameManager = Manager;
|
|
}
|
|
|
|
public override void OnPickupUseDown()
|
|
{
|
|
VRCPlayerApi LocalPlayer = Networking.LocalPlayer;
|
|
if (_Podium.GetPlayerID() == LocalPlayer.playerId)
|
|
{
|
|
_GameManager.SendCustomNetworkEvent(NetworkEventTarget.Owner,
|
|
"PlayerBuzzedIn", _Podium.PlayerNumber);
|
|
}
|
|
|
|
_Animator.SetBool("Trigger Pull", true);
|
|
|
|
base.OnPickupUseDown();
|
|
}
|
|
|
|
public override void OnPickupUseUp()
|
|
{
|
|
_Animator.SetBool("Trigger Pull", false);
|
|
|
|
base.OnPickupUseUp();
|
|
}
|
|
}
|