public static void Notify(this CoroutineLockComponent self, CoroutineLockType coroutineLockType, long key, int count) { CoroutineLockQueueType coroutineLockQueueType = self.list[(int)coroutineLockType]; if (!coroutineLockQueueType.TryGetValue(key, out CoroutineLockQueue queue)) { return; } if (queue.Count == 0) { coroutineLockQueueType.Remove(key); return; } #if NOT_UNITY const int frameCoroutineCount = 5; #else const int frameCoroutineCount = 10; #endif if (count > frameCoroutineCount) { self.NextFrameRun(coroutineLockType, key); return; } CoroutineLockInfo coroutineLockInfo = queue.Dequeue(); coroutineLockInfo.Tcs.SetResult(self.CreateCoroutineLock(coroutineLockType, key, coroutineLockInfo.Time, count)); }
public static void Notify(this CoroutineLockComponent self, int coroutineLockType, long key, int level) { CoroutineLockQueueType coroutineLockQueueType = self.list[coroutineLockType]; if (!coroutineLockQueueType.TryGetValue(key, out CoroutineLockQueue queue)) { return; } if (queue.Count == 0) { coroutineLockQueueType.Remove(key); return; } CoroutineLockInfo coroutineLockInfo = queue.Dequeue(); coroutineLockInfo.Tcs.SetResult(self.CreateCoroutineLock(coroutineLockType, key, coroutineLockInfo.Time, level)); }
private static void Notify(this CoroutineLockComponent self, int coroutineLockType, long key, int level) { CoroutineLockQueueType coroutineLockQueueType = self.list[coroutineLockType]; CoroutineLockQueue queue = coroutineLockQueueType.GetChild <CoroutineLockQueue>(key); if (queue == null) { return; } if (queue.Count == 0) { coroutineLockQueueType.RemoveChild(key); return; } CoroutineLockInfo coroutineLockInfo = queue.Dequeue(); coroutineLockInfo.Tcs.SetResult(self.CreateCoroutineLock(queue, coroutineLockType, key, coroutineLockInfo.Time, level)); }