Advertisement
Munchy2007

screenfader7

May 25th, 2016
4,165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1.     static IEnumerator FadeOutCoRoutine(float delayBefore, float delayAfter, System.Action callback)
  2.     {
  3.         yield return new WaitForSeconds(delayBefore);
  4.         while(group.alpha < 1)
  5.         {
  6.             group.alpha = Mathf.MoveTowards(group.alpha, 1f, instance.speed * Time.deltaTime);
  7.             yield return null;
  8.         }
  9.         yield return new WaitForSeconds(delayAfter);
  10.         if (callback != null) callback();
  11.        
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement