using UnityEngine; using UnityGameFramework.Runtime; namespace SepCore.CameraModule { /// /// UnityGameFramework 侧的相机模块组件。 /// 作为 GameEntry.CameraModule 访问入口,统一持有并转发 CameraModule 控制器能力。 /// [DisallowMultipleComponent] public class CameraModuleComponent : GameFrameworkComponent { [SerializeField] private CinemachineCameraController _cinemachineController = null; public void SetTarget(Transform target) { if (!EnsureController()) return; _cinemachineController.SetTarget(target); } public void ApplySettings(CameraEffectSettings settings) { if (!EnsureController()) return; _cinemachineController.ApplySettings(settings); } public void EnableEffect(CameraEffectType effect) { if (!EnsureController()) return; _cinemachineController.EnableEffect(effect); } public void DisableEffect(CameraEffectType effect) { if (!EnsureController()) return; _cinemachineController.DisableEffect(effect); } public bool IsEffectEnabled(CameraEffectType effect) { if (!EnsureController()) return false; return _cinemachineController.IsEffectEnabled(effect); } private bool EnsureController() { if (_cinemachineController != null) { return true; } Log.Error("CameraModuleComponent requires a CinemachineCameraController. Assign one in Inspector."); return false; } } }