public GameSceneCameraSystem(GameButton btnback) { this.m_mainCameraTran = Camera.main.transform; this.m_mainCamera = this.m_mainCameraTran.GetComponent <GameCameraNew>(); this.m_mainCameraParam = this.m_mainCameraTran.GetComponent <SceneCameraParams_New>(); this.m_origPosition = this.m_mainCameraTran.position; this.m_origRotate = this.m_mainCameraTran.eulerAngles; this.m_btnBack = btnback; GameEvents.SceneEvents.OnClickQuitScene += OnClickQuitScene; this.m_mainCamera.backAction = FingerBackScene; LoadCameraPoint(); this.m_currentCamera = "MainCamera"; GameEvents.SceneEvents.EntityInCurrentCamera = EntityInCurrentCamera; EngineCoreEvents.InputEvent.OnOneFingerTouchup += OnTouchScreen; }
public void InitCameraController <T>(bool isEnable = true) where T : GameCameraNew { if (this.m_gameCameraController != null) { if (!(this.m_gameCameraController is T)) { GameObject.Destroy(this.m_gameCameraController); this.m_gameCameraController = MainCamera.gameObject.AddComponent <T>(); } } else { this.m_gameCameraController = MainCamera.gameObject.AddComponent <T>(); } this.m_gameCameraController.enabled = isEnable; }