Beispiel #1
0
 private void TickFunc()
 {
     if (ConditionFunc_?.Invoke() ?? true)
     {
         Done();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Return T when TickFunc return true
 /// </summary>
 public T ForeachReturn(LiteFunc <T, bool> TickFunc)
 {
     Flush();
     InEach_++;
     foreach (var Item in Values_)
     {
         if (TickFunc?.Invoke(Item) == true)
         {
             return(Item);
         }
     }
     InEach_--;
     return(default);
Beispiel #3
0
        public T Spawn()
        {
            if (ObjectCacheList_.Count > 0)
            {
                UsedCount++;
                IdleCount--;
                var TCache = ObjectCacheList_.Dequeue();
                TriggerSpawn(TCache);
                return(TCache);
            }

            var NewCache = CreateFunc_.Invoke();

            TriggerSpawn(NewCache);
            UsedCount++;

            return(NewCache);
        }
Beispiel #4
0
 public override void Tick(float DeltaTime)
 {
     IsEnd = ConditionFunc_?.Invoke() ?? true;
 }