Пример #1
0
            public void Update()
            {
                if (currentAction == null)
                {
                    if (actions.Count == 0)
                    {
                        ezes        -= Update;
                        ezes_global -= Update;
                        return;
                    }
                    currentAction = actions.Dequeue();
                }
                var delta = Time.deltaTime;

                if (timer < currentAction.duration)
                {
                    timer += delta;
                    currentAction.action(timer / currentAction.duration);
                    return;
                }
                currentAction.action(1);
                timer -= currentAction.duration;
                if (isLooped)
                {
                    actions.Enqueue(currentAction);
                }
                currentAction = null;
            }
Пример #2
0
 public EZQueue Wait(Func <bool> a)
 {
     Add(float.MaxValue, t =>
     {
         if (!a())
         {
             return;
         }
         timer         = 0;
         currentAction = null;
     }).Wait(0.3f);
     return(this);
 }