示例#1
0
    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();
        }
    }
示例#2
0
 public Coroutine BlendToMatrix(Matrix4x4 targetMatrix, float duration, MatrixBlendEnded endCallback = null)
 {
     StopAllCoroutines();
     return(StartCoroutine(LerpFromTo(m_Camera.projectionMatrix, targetMatrix, duration, endCallback)));
 }
示例#3
0
 public void SetOrthographic(bool value, MatrixBlendEnded endCallback)
 {
     orthoOn         = value;
     currentCallback = endCallback;
     Blend();
 }