コード例 #1
0
ファイル: CameraCircle.cs プロジェクト: midgithub/notes
        public Transform UpdateMainCameraTransform()
        {
            float      ainHeight       = m_target.position.y + m_height * (m_distance / HEIGHTSLOPE);
            Quaternion currentRotation = Quaternion.Euler(0, m_rotationAngle, 0);

            // Set the position of the camera on the x-z plane to:
            m_transform.position  = m_target.position;
            m_transform.position += currentRotation * Vector3.forward * m_distance;

            // Set the height of the camera
            m_transform.position = new Vector3(m_transform.position.x, ainHeight, m_transform.position.z);

            // Always look at the target
            m_transform.LookAt(m_target);

            if (m_distance >= m_dstDistance)
            {
                m_distance--;
            }
            else if (m_rotationAngle <= m_InitRotaionAngle + AccmulatedRotation)
            {
                m_rotationAngle++;
            }
            else
            {
                //拉近和旋转都已经完成,应该切换相机
                CameraBossProcedure.ChangeToCameraLookAtBossProcedure();
            }
            return(m_transform);
        }
コード例 #2
0
ファイル: BossCameraTrigger.cs プロジェクト: midgithub/notes
 // Use this for initialization
 void Start()
 {
     CameraBossProcedure.ChangeToCameraCircleProcedure();
 }