TH1/Unity/Assets/Scripts/UI/PreviewCameraController.cs
2025-07-24 21:24:09 +08:00

22 lines
600 B
C#

using System.Collections;
using System.Collections.Generic;
using ET.Client;
using UnityEngine;
public class PreviewCameraController : MonoBehaviour
{
public GameObject FollowMainCamera;
private Camera _camera;
public void Update()
{
if (!gameObject.activeSelf) return;
if (_camera != null && FollowMainCamera != null && FollowMainCamera.GetComponent<Camera>() != null)
_camera.orthographicSize = FollowMainCamera.GetComponent<Camera>().orthographicSize;
}
public void Start()
{
_camera = GetComponent<Camera>();
}
}