void DestroyGame() { if (GrayOutBackground != null) { GrayOutBackground.SetActive(false); } if (currentGame != null) { currentGame.gameObject.SetActive(false); } currentGame = null; }
void StartGame(GameType game) { DestroyGame(); switch (game) { case GameType.MonsterPetting: currentGame = MonsterPetting; break; case GameType.LetterTracing: currentGame = LetterTracing; break; case GameType.MemoryGame: currentGame = MemoryGame; break; } if (currentGame != null) { currentGame.gameObject.SetActive(true); currentGame.init(CurrentMonster); if (game == GameType.MonsterPetting) { TutorialController.Instance.StartTutorial(game); } else if (game == GameType.MemoryGame) { if (GrayOutBackground != null) { GrayOutBackground.SetActive(true); //GrayOutBackground.transform.SetAsFirstSibling (); } } } else { onMiniGameDone(); } }