TheStable/Assets/MyroP/Arcade/Common/Code/CameraScaleConstraint.cs
Jamie Greunbaum 542e04afed - Replaced one skee-ball machine with two arcade machines.
- Added Black Horse And The Cherry Tree by KT Tunstall to the horse playlist.
- Added Buckin' My Horse by Sir Mix-A-Lot to the horse playlist.
2026-02-11 02:58:41 -05:00

24 lines
485 B
C#

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace myro.arcade
{
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
[RequireComponent(typeof(Camera))]
public class CameraScaleConstraint : UdonSharpBehaviour
{
public Transform ConstraintTo;
void Start()
{
Camera cam = GetComponent<Camera>();
float scale = ConstraintTo.lossyScale.x;
cam.orthographicSize *= scale;
cam.nearClipPlane *= scale;
cam.farClipPlane *= scale;
}
}
}