Advertisement
Guest User

Untitled

a guest
May 6th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. IEnumerator WaitThenCallThisConstantly(float time,float smoothTime,int counter,int maxTimes) {
  2.  
  3.     yield return new WaitForSeconds (time);
  4.  
  5.     float zoom = 4.25f; float smooth = 5.0f;
  6.     float normal = 4.95f; //increase this to a bigger value to zoom out even more
  7.  
  8.  
  9.     counter++;
  10.     if (counter < maxTimes) {
  11.  
  12.         mainCamera.orthographicSize = Mathf.Lerp(mainCamera.orthographicSize,normal,Time.deltaTime * (counter/2.0f) *smooth);
  13.         StartCoroutine(WaitThenCallThisConstantly(time,smoothTime,counter,maxTimes));
  14.  
  15.     }    
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement