public override void OnExit() { if (AnimatedChuzzles.Any()) { Debug.LogError("F**K YOU FROM WIN REMOVE: " + AnimatedChuzzles.Count); } }
public override void LateUpdateState() { if (!AnimatedChuzzles.Any()) { LateUpdateState(Gamefield.Level.ActiveCells); } }
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 CheckAnimationCompleted() { if (!AnimatedChuzzles.Any()) { CheckCombinations(); } }
public override void OnExit() { if (AnimatedChuzzles.Any()) { Debug.LogError("F**K YOU FROM CREATE NEW STATE: " + AnimatedChuzzles.Count); } Gamefield.NewTilesInColumns = new int[Gamefield.Level.Width]; }
public void OnAnimationFinished(Chuzzle chuzzle) { chuzzle.AnimationFinished -= OnAnimationFinished; AnimatedChuzzles.Remove(chuzzle); if (!AnimatedChuzzles.Any()) { Gamefield.SwitchStateTo(Gamefield.WinCreateNewChuzzlesState); } }
public override void OnExit() { if (AnimatedChuzzles.Any()) { Debug.LogError("F**K you in field state: " + AnimatedChuzzles.Count); } Gamefield.GameMode.HumanTurn(); Reset(); }
public override void OnExit() { if (AnimatedChuzzles.Any()) { Debug.LogError("F**K YOU FROM REMOVE COMBINATION: " + AnimatedChuzzles.Count); } PowerUpDestroyManager.Instance.IsInDestroyState = false; }
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); } } }
private IEnumerator RemoveCombinations() { var powerUpCombination = GamefieldUtility.FindOnlyOneCombinationWithCondition(Gamefield.Chuzzles, GamefieldUtility.IsPowerUp); //if has any powerups if (powerUpCombination.Any()) { //destroy step by step PowerUpDestroyManager.Instance.Destroy(powerUpCombination); if (!AnimatedChuzzles.Any()) { Gamefield.SwitchStateTo(Gamefield.CreateNewChuzzlesState); } } else { var combinations = GamefieldUtility.FindCombinations(Gamefield.Chuzzles); //remove combinations foreach (var combination in combinations) { Gamefield.InvokeCombinationDestroyed(combination); foreach (var chuzzle in combination) { chuzzle.Destroy(true); } if (!AnimatedChuzzles.Any()) { Gamefield.SwitchStateTo(Gamefield.CreateNewChuzzlesState); } yield return(new WaitForSeconds(0.05f)); } } yield return(new WaitForEndOfFrame()); }