private IEnumerator LerpFromTo(Matrix4x4 src, Matrix4x4 dest, float duration, MatrixBlendEnded endCallback) { float startTime = Time.time; while (Time.time - startTime < duration) { m_Camera.projectionMatrix = MatrixLerp(src, dest, (Time.time - startTime) / duration); yield return(1); } m_Camera.projectionMatrix = dest; if (endCallback != null) { endCallback.Invoke(); } }
public Coroutine BlendToMatrix(Matrix4x4 targetMatrix, float duration, MatrixBlendEnded endCallback = null) { StopAllCoroutines(); return(StartCoroutine(LerpFromTo(m_Camera.projectionMatrix, targetMatrix, duration, endCallback))); }
public void SetOrthographic(bool value, MatrixBlendEnded endCallback) { orthoOn = value; currentCallback = endCallback; Blend(); }