using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Rokid.UXR.Utility { /// /// 全局常量配置 /// public class MainCameraCache { private static Camera cameraCache; public static Camera mainCamera { get { if (cameraCache == null) { cameraCache = Camera.main; } if (cameraCache == null) { RKLog.Warning("Please Create a Main Camera!!!"); } return cameraCache; } } /// /// Manually update the cached main camera /// public static void UpdateCachedMainCamera(Camera camera) { if (camera != cameraCache) { GameObject.Destroy(cameraCache); cameraCache = camera; } } } }