Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 30th, 2012  |  syntax: C#  |  size: 0.29 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Neat random snippet to put in a MonoBehaviour base class (for people who love lambdas)
  2.  
  3.         IEnumerator Do(System.Action action, float time)
  4.         {
  5.                 yield return new WaitForSeconds(time);
  6.                 action();
  7.         }
  8.        
  9.         void Invoke(System.Action action, float time)
  10.         {
  11.                 StartCoroutine(Do(action, time));
  12.         }