public IEnumerator Pan(CallBackResource callback) { while (focusTime > 0.0f) { focusTime -= Time.deltaTime; m_Camera.transform.position = Vector3.Lerp(startPos, endPos, (tspan - focusTime) / tspan); yield return new WaitForEndOfFrame(); } callback(); }
public void nextLevel() { if (lData.Length == currentLevel + 1) { Debug.Log("You Won!"); // TODO:Celebrate } else { currentLevel++; m_CamAnimator.panToFocii(currentLevel, lData[currentLevel].PanTime); callbackFct = SetupResource; StartCoroutine(m_CamAnimator.Pan(callbackFct)); } }