Exemple #1
0
 private IEnumerator __DelayFunction(VanillaFunction call, float time)
 {
     if (time <= 0f)
     {
         yield return(0f);
     }
     else
     {
         yield return(new WaitForSeconds(time));
     }
     call();
 }
Exemple #2
0
 /// <summary>
 /// For delaying a function call by a single frame.
 /// </summary>
 /// <param name="Call">Parameter-less function</param>
 /// <param name="Time">How long to delay by. To delay by 1 frame, Time == 0.</param>
 /// <returns></returns>
 public static void DelayFunction(VanillaFunction Call, float Time)
 {
     GetSelf()._delayFunction(Call, Time);
 }
Exemple #3
0
 private void _delayFunction(VanillaFunction call, float time)
 {
     StartCoroutine(__DelayFunction(call, time));
 }
Exemple #4
0
 /// <summary>
 /// For delaying a function call by a single frame.
 /// </summary>
 /// <param name="Call">Parameter-less function</param>
 /// <param name="Time">How long to delay by. To delay by 1 frame, Time == 0.</param>
 /// <returns></returns>
 public static void DelayFunction(VanillaFunction Call, float Time)
 {
     instance.StartCoroutine(instance._delayFunction(Call, Time));
 }