TheStable/Assets/Scripts/TriggerToggle.cs
Jamie Greunbaum 28ff97104a - Skee-ball will now only score if the person who threw the ball is the player.
- Skee-ball sounds compressed more without sacrificing quality.
- Size of stable and game room reflection maps increased to 128x128.
- Added a separate reflection map to the top of the pool table.
- Added Horse Portraits™ to the game room.
2026-02-12 04:16:57 -05:00

35 lines
853 B
C#

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class TriggerToggle : UdonSharpBehaviour
{
[SerializeField] private Collider _Collider = null;
[SerializeField] private GameObject _ToggledObject = null;
[Tooltip("When true, object is active when player is inside trigger volume. If false, object is inactive when inside trigger volume.")]
[SerializeField] private bool _ActiveOnTrigger = true;
public override void OnPlayerTriggerEnter(VRCPlayerApi Player)
{
if (Player.isLocal)
{
_ToggledObject.SetActive(_ActiveOnTrigger);
}
base.OnPlayerTriggerEnter(Player);
}
public override void OnPlayerTriggerExit(VRCPlayerApi Player)
{
if (Player.isLocal)
{
_ToggledObject.SetActive(!_ActiveOnTrigger);
}
base.OnPlayerTriggerExit(Player);
}
}