/// <summary> /// Monobehavior Start call back. /// Get three type of camera's reference and set initial values. /// </summary> private void Awake() { m_firstPersonCamera = gameObject.GetComponent <FirstPersonCamera>() as IBaseCamera; if (m_firstPersonCamera == null) { m_firstPersonCamera = gameObject.AddComponent <FirstPersonCamera>(); } m_firstPersonCamera.SetCamera(m_targetObject, Vector3.zero, 0.5f); m_thirdPersonCamera = gameObject.GetComponent <ThirdPersonCamera>() as IBaseCamera; if (m_thirdPersonCamera == null) { m_thirdPersonCamera = gameObject.AddComponent <ThirdPersonCamera>(); } m_thirdPersonCamera.SetCamera(m_targetObject, new Vector3(0.5f, 0.5f, -2.0f), 0.5f); m_topDownCamera = gameObject.GetComponent <TopDownCamera>() as IBaseCamera; if (m_topDownCamera == null) { m_topDownCamera = gameObject.AddComponent <TopDownCamera>(); } m_topDownCamera.SetCamera(m_targetObject, new Vector3(0.0f, 15.0f, 0.0f), 0.5f); EnableCamera(CameraType.FIRST_PERSON); _SetCursorState(); }
/// <summary> /// Monobehavior Start call back. /// Get three type of camera's reference and set initial values. /// </summary> private void Awake() { m_firstPersonCamera = gameObject.GetComponent<FirstPersonCamera>() as IBaseCamera; if (m_firstPersonCamera == null) { m_firstPersonCamera = gameObject.AddComponent<FirstPersonCamera>(); } m_firstPersonCamera.SetCamera(m_targetObject, Vector3.zero, 0.5f); m_thirdPersonCamera = gameObject.GetComponent<ThirdPersonCamera>() as IBaseCamera; if (m_thirdPersonCamera == null) { m_thirdPersonCamera = gameObject.AddComponent<ThirdPersonCamera>(); } m_thirdPersonCamera.SetCamera(m_targetObject, new Vector3(5f, 5f, -5f), 0.5f); m_topDownCamera = gameObject.GetComponent<TopDownCamera>() as IBaseCamera; if (m_topDownCamera == null) { m_topDownCamera = gameObject.AddComponent<TopDownCamera>(); } m_topDownCamera.SetCamera(m_targetObject, new Vector3(0.0f, 15.0f, 0.0f), 0.5f); if(m_startInThirdPerson) { EnableCamera(CameraType.THIRD_PERSON); } else { EnableCamera(CameraType.FIRST_PERSON); } _SetCursorState(); }