Пример #1
0
    public override void UpdateCamera()
    {
        return;

        //calculate eye offset
        m_EyeOffset = m_EyeLocation.transform.position;

        //set the camera's position to be equal to the player's position plus the offset for the eye
        m_Camera.transform.position = m_EyeLocation.transform.position;
        m_Camera.transform.rotation = m_EyeLocation.transform.rotation;

        //get the change in eulerAngles this frame between the player and the camera
        Vector3 eulerAngleDiff = m_Player.transform.rotation.eulerAngles - m_Camera.transform.rotation.eulerAngles;

        eulerAngleDiff.x = m_Player.PitchChange;

        Quaternion quat = Quaternion.Euler(m_Camera.transform.rotation.eulerAngles + eulerAngleDiff);

        //rotate the camera based on the difference in eulerAngles
        m_Camera.transform.rotation = MathFunc.ClampQuaternionXRotation(quat, MaximumX, MinimumX);
    }