private void TickFunc() { if (ConditionFunc_?.Invoke() ?? true) { Done(); } }
/// <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);
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); }
public override void Tick(float DeltaTime) { IsEnd = ConditionFunc_?.Invoke() ?? true; }