Exemplo n.º 1
0
    private IEnumerator Wait(float delay, DelayEvent e)
    {
        var wait = new WaitForSeconds(delay);

        yield return(wait);

        e.Invoke();
        e.Destroy();
    }
Exemplo n.º 2
0
 void OnEnable()
 {
     _jobs = new AsyncHelper.DelayedJob[delayEvents.Length];
     for (int i = 0; i < delayEvents.Length; i++)
     {
         float      delay      = delayEvents[i].delaySeconds;
         DelayEvent onComplete = delayEvents[i].onDelayAfterOnEnable;
         _jobs[i] = AsyncHelper.DoAfterDelay(delay, () => {
             onComplete?.Invoke();
         }
                                             );
     }
 }