Beispiel #1
0
        /// <summary>
        /// Zoom of the given distance. Note that distance need to be a param between 0...1,a d the distance is a ratio
        /// </summary>
        /// <param name="distance">The distance to zoom, need to be in range [0..1] (will be clamped) </param>
        public void Zoom(float distance)
        {
            m_CurrentDistance = Mathf.Clamp01(m_CurrentDistance + distance);

            Vector3 rotation = transform.rotation.eulerAngles;

            rotation.x         = Mathf.LerpAngle(MinAngle, MaxAngle, m_CurrentDistance);
            transform.rotation = Quaternion.Euler(rotation);

            m_FramingTransposer.m_CameraDistance = Mathf.Lerp(MinDistance, MaxDistance, m_CurrentDistance);

            AmbiencePlayer.UpdateVolume(m_CurrentDistance);
        }
Beispiel #2
0
 void Awake()
 {
     s_Instance = this;
 }