Jamie Greunbaum 8eaef49f2e - Added game room, including pool and skee-ball.
- Moved video screen into its own separate movie tent.
- Adjusted stable post-processing volume.
- Chickens are now at full volume.
- Added button to toggle chickens off and on.
2026-02-09 03:49:54 -05:00

58 lines
1.6 KiB
C#

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
namespace Pyralix.SkeeBall
{
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class StartResetButton : UdonSharpBehaviour
{
[SerializeField] SkeeballMain SkeeballMain;
[SerializeField] private AudioSource Speaker;
[SerializeField] private AudioClip OnSound;
[SerializeField] private AudioClip OffSound;
[SerializeField] private GameObject PowerLights;
[SerializeField] private GameObject Button;
[UdonSynced] private bool ButtonLightOn;
public override void Interact()
{
if (PowerLights.activeSelf)
{
ButtonLightOn = false;
Speaker.PlayOneShot(OffSound, SkeeballMain._AudioVolume);
Button.SetActive(false);
}
else
{
ButtonLightOn = true;
Speaker.PlayOneShot(OnSound, SkeeballMain._AudioVolume);
Button.SetActive(true);
}
RequestSerialization();
SkeeballMain._SetGameOwnerAndTogglePower(Networking.LocalPlayer);
}
public void _TurnOffButtonLight()
{
Button.SetActive(false);
ButtonLightOn = false;
RequestSerialization();
}
public override void OnDeserialization()
{
if (ButtonLightOn)
{
Button.SetActive(true);
}
else
{
Button.SetActive(false);
}
}
}
}