/// <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); }
void Awake() { s_Instance = this; }