- 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.
49 lines
1.1 KiB
C#
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
|
|
}
|