private void Initialize() { GridManager.Initialize(this, SelectorManager, Stats, ParticleManager); SelectorManager.Initialize(this, GridManager, InputManager, SelectorManager, Stats.MoveCount); Stats.Initialize(this); ParticleManager.Initialize(); InputManager.Initialize(SelectorManager); BombPieceManager.Initialize(this, GridManager); ExplosionSystem.Initialize(this, Stats.Score, ParticleManager, GridManager); }
/// <summary> /// The main func that Sets level requirements and Starts the game. /// </summary> public void StartGame() { Stats.StartGame(CurrentGameMode.ScoreMultiplier); UIManager.StartGame(); Color[] colors = CurrentGameMode.Colors.ToArray(); ParticleManager.StartGame(colors); GridManager.StartGame(CurrentGameMode.GridXLength, CurrentGameMode.GridYLength, CurrentGameMode.BombScoreLimit, colors); SelectorManager.StartGame(GridManager.oneSideScale, CurrentGameMode.GridElements); ExplosionSystem.StartGame(CurrentGameMode.ExplosionTypes, CurrentGameMode.GridYLength); InputManager.IsReadyForInput = true; }
public override IEnumerator TurnRoutine(int angleDir) { mInputManager.IsReadyForInput = false; List <Transform> selecteds = mSelectorManager.SelectedPieceGroup.GiveGroup(mGridManager); InitializeSelecteds(selecteds); Vector3 startEuler = mSelectorManager.CurrentSelectorObject.transform.rotation.eulerAngles; int indexTurnDir = selecteds.CheckIfItsHaveAHighestXValue() == true ? angleDir : -angleDir; for (int i = 0; i < 3; i++) { for (int x = 0; x < 10; x++) { startEuler.z += (12f * angleDir); mSelectorManager.CurrentSelectorObject.transform.rotation = Quaternion.Euler(startEuler); yield return(new WaitForFixedUpdate()); } for (int b = 0; b < selecteds.Count; b++) { selecteds[b].GetComponent <GridPiece>().CorrectRotation(); } TurnSelectedIndexes(indexTurnDir); yield return(new WaitForSeconds(0.05f)); if (ExplosionSystem.IsAnyExplosion) { ResetSelecteds(selecteds); mSelectorManager.CurrentSelectorObject.SetActive(false); mMoveCount.Moved(); yield return(mGameManager.StartCoroutine(ExplosionSystem.Explode())); yield break; } } ResetSelecteds(selecteds); mInputManager.IsReadyForInput = true; }