- Fixed jail chain potentially calling a GameManager function on all clients.
25 lines
557 B
C#
25 lines
557 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.SDK3.Components;
|
|
using VRC.SDKBase;
|
|
|
|
|
|
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
|
public class CameraAutoLevel : UdonSharpBehaviour
|
|
{
|
|
[SerializeField] private VRCObjectSync _Camera;
|
|
|
|
|
|
public override void Interact()
|
|
{
|
|
if (Utilities.IsValid(_Camera))
|
|
{
|
|
Transform TeleportLocation = _Camera.transform;
|
|
Vector3 oldRotation = TeleportLocation.eulerAngles;
|
|
TeleportLocation.eulerAngles = new Vector3(oldRotation.x, oldRotation.y, 0.0f);
|
|
_Camera.TeleportTo(TeleportLocation);
|
|
}
|
|
}
|
|
}
|