private void ReduceFinished(Circle circle) { circle.OnReduceFinished -= ReduceFinished; foreach (var c in _circles.Values) { if (c.OnReduceFinishedEventCountInvocation != null && c.OnReduceFinishedEventCountInvocation >= 1) { return; } } DestroyLevel(); OnNextLevelReady?.Invoke(); }
private void Reduce() { LifeTime--; foreach (var circle in _circles.Values) { circle.OnReduceFinished += ReduceFinished; circle.Reduce(); } OnReduce?.Invoke(); if (_circles.Count == 0) { OnNextLevelReady?.Invoke(); } }