Jamie Greunbaum 718cb33ac8 - Improved camera switcher enable/disable code.
- Added new round 1 switchers, and fixed overlap issues with the existing ones.
- Improved camera switch buttons on the host panel.
- Potato Mode button on the camera host panel now toggles properly.
- Potato Mode button renamed to the more appropriate Performance button.
- Glass shatter window effect now works from both directions.
- Round 1 window looks much prettier.
- Added the ability to scroll through overflowing text on the host card.
- Improved scrolling on the credits panel.
2026-03-19 05:26:17 -04:00

49 lines
1.1 KiB
C#

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class CameraTimerSwitchTrigger : UdonSharpBehaviour
{
[SerializeField] private CameraControllerBase _CameraController;
[SerializeField] private string _EnterSwitchFunction = "";
[SerializeField] private string _ExitSwitchFunction = "";
public override void OnPlayerTriggerEnter(VRCPlayerApi Player)
{
if (Networking.GetOwner(_CameraController.gameObject) == Networking.LocalPlayer)
{
if (_EnterSwitchFunction != "")
{
_CameraController.SendCustomEvent(_EnterSwitchFunction);
}
}
base.OnPlayerTriggerEnter(Player);
}
public override void OnPlayerTriggerExit(VRCPlayerApi Player)
{
if (Networking.GetOwner(_CameraController.gameObject) == Networking.LocalPlayer)
{
if (_ExitSwitchFunction != "")
{
_CameraController.SendCustomEvent(_ExitSwitchFunction);
}
}
base.OnPlayerTriggerExit(Player);
}
#if UNITY_EDITOR
private void OnDrawGizmos()
{
Gizmos.DrawIcon(transform.position, "CameraSwitcher", true);
}
#endif
}