private void OnAnimationFinished(Chuzzle chuzzle) { chuzzle.AnimationFinished -= OnAnimationFinished; AnimatedChuzzles.Remove(chuzzle); CheckAnimationCompleted(); }
public void OnAnimationFinished(Chuzzle chuzzle) { chuzzle.Real = chuzzle.Current = chuzzle.MoveTo; chuzzle.AnimationFinished -= OnAnimationFinished; AnimatedChuzzles.Remove(chuzzle); if (isAlreadyChangedState) { Debug.LogWarning("Finished in CRNC state "); } if (!AnimatedChuzzles.Any() && !isAlreadyChangedState) { Gamefield.Level.UpdateActive(); var combinations = GamefieldUtility.FindCombinations(Gamefield.Level.ActiveChuzzles); if (combinations.Count > 0) { Gamefield.SwitchStateTo(Gamefield.CheckSpecialState); } else { if (!Gamefield.GameMode.IsWin && !Gamefield.GameMode.IsGameOver) { Gamefield.SwitchStateTo(Gamefield.FieldState); } else { Gamefield.GameMode.Check(); } } isAlreadyChangedState = true; } }
public void OnAnimationFinished(Chuzzle chuzzle) { chuzzle.AnimationFinished -= OnAnimationFinished; AnimatedChuzzles.Remove(chuzzle); if (!AnimatedChuzzles.Any()) { Gamefield.SwitchStateTo(Gamefield.WinCreateNewChuzzlesState); } }
private void OnAnimationFinished(Chuzzle chuzzle) { chuzzle.AnimationFinished -= OnAnimationFinished; AnimatedChuzzles.Remove(chuzzle); chuzzle.Destroy(true, false); if (!AnimatedChuzzles.Any()) { Gamefield.SwitchStateTo(Gamefield.WinCreateNewChuzzlesState); } }
public void OnAnimationFinished(Chuzzle chuzzle) { chuzzle.Real = chuzzle.Current = chuzzle.MoveTo; chuzzle.AnimationFinished -= OnAnimationFinished; AnimatedChuzzles.Remove(chuzzle); if (!AnimatedChuzzles.Any()) { Gamefield.Level.UpdateActive(); var combinations = GamefieldUtility.FindCombinations(Gamefield.Level.ActiveChuzzles); if (combinations.Count > 0) { Gamefield.SwitchStateTo(Gamefield.WinCheckSpecialState); } else { Gamefield.SwitchStateTo(Gamefield.WinRemoveCombinationState); } } }