feat: Introduce DownCount feature with new models, scripts, textures, and a dedicated quiz scene.
This commit is contained in:
30
Assets/Quiz/Scripts/DownCount/DownCountClock.cs
Normal file
30
Assets/Quiz/Scripts/DownCount/DownCountClock.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.UdonNetworkCalling;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
|
||||
public class DownCountClock : UdonSharpBehaviour
|
||||
{
|
||||
public Animator clockAnimator;
|
||||
public AudioSource clockAudioSource;
|
||||
|
||||
public void StartNetworkedClock()
|
||||
{
|
||||
SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, "StartClock");
|
||||
}
|
||||
|
||||
[NetworkCallable]
|
||||
public void StartClock()
|
||||
{
|
||||
if (clockAnimator != null)
|
||||
{
|
||||
clockAnimator.SetTrigger("StartCountdown");
|
||||
}
|
||||
if (clockAudioSource != null && !clockAudioSource.isPlaying)
|
||||
{
|
||||
clockAudioSource.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user