protected override void Start()
        {
            base.Start();

            currentState = DontWakeUpMinigameState.Initializing;
            RoundsTotal  = Levels.Length;
            currentRound = StartingLevel;
            currentLevel = currentRound;
            LivesLeft    = 4;
            //AppManager.I.InitDataAI();
            AppManager.I.CurrentGameManagerGO = gameObject;

            //LoggerEA4S.Log("minigame", "dontwakeup", "start", "");
            //LoggerEA4S.Save();

            ResetAntura();

            AudioManager.I.PlayMusic(SceneMusic);
            AudioManager.I.PlaySfx(Sfx.DogSnoring);

            SceneTransitioner.Close();

            //StartCurrentRound();
            currentState = DontWakeUpMinigameState.GameIntro;
            Invoke("GameIntro", 2);
        }
        public void GameLost()
        {
            WidgetPopupWindow.I.Close();
            currentState = DontWakeUpMinigameState.GameEnd;
            StopSceneSounds();

            StartCoroutine(EndGame_ShowResults(0));
        }
        public void InitRound()
        {
            currentState = DontWakeUpMinigameState.RoundIntro;

            UpdateLivesContainer();
            SetupLevel();

            //WidgetPopupWindow.I.ShowStringAndWord(ClickedNext, currentRound.ToString(), currentWord);
            SpeakCurrentLetter();
        }
 public void DoPause(bool status)
 {
     Debug.Log("GameDontWakeUp DoPause() " + status);
     if (currentState == DontWakeUpMinigameState.Playing)
     {
         currentState = DontWakeUpMinigameState.Paused;
     }
     else if (currentState == DontWakeUpMinigameState.Paused)
     {
         currentState = DontWakeUpMinigameState.Playing;
     }
 }
        public void GameWon()
        {
            currentState = DontWakeUpMinigameState.GameEnd;
            StopSceneSounds();
            AudioManager.I.PlaySfx(Sfx.Win);

            if (LivesLeft >= 3)
            {
                LivesLeft = 3;
            }

            StartCoroutine(EndGame_ShowResults(LivesLeft));
        }
 public void RoundWon()
 {
     currentState = DontWakeUpMinigameState.Paused;
     myLetter.SetActive(false);
     //LoggerEA4S.Log("minigame", "dontwakeup", "wordFinished", "");
     if (currentRound < RoundsTotal)
     {
         GoToNextRound();
     }
     else
     {
         GameWon();
     }
 }
        public void RoundLost(How2Die how)
        {
            if (currentState != DontWakeUpMinigameState.RoundEnd)
            {
                currentState = DontWakeUpMinigameState.RoundEnd;
                resetDanger();
                myLetter.SetActive(false);

                AudioManager.I.StopSfx(Sfx.DangerClock);
                AudioManager.I.PlaySfx(Sfx.Lose);

                if (LivesLeft > 0)
                {
                    LivesLeft = LivesLeft - 1;
                    UpdateLivesContainer();
                }

                Instantiate(ExplosionParticles, myLetter.transform.position, Quaternion.identity);

                switch (how)
                {
                case How2Die.TouchedAlarm:
                    currentLevelController.DoAlarmEverything();
                    AnturaHasWokenUp();
                    Invoke("RoundLostAlarmsFinished", 2);
                    break;

                case How2Die.TouchedDog:
                    AnturaHasWokenUp();
                    CameraGameplayController.I.MoveToPosition(CameraWakeUpAntura.transform.position, CameraWakeUpAntura.transform.rotation);
                    Invoke("RoundLostTouchedDogFinished", 3);
                    break;

                case How2Die.TooFast:
                    Invoke("RoundLostTooFastFinished", 2);
                    break;

                case How2Die.Fall:
                    Invoke("RoundLostFallFinished", 1);
                    break;
                }
            }
        }
        //        public void GameIntroFinished()
        //        {
        //            WidgetSubtitles.I.Close();
        //            //WidgetPopupWindow.Show(false);
        //            StartCurrentRound();
        //        }
        //
        //        private void ShowTutorialLine()
        //        {
        //            switch (TutorialIndex) {
        //                case 3:
        //                    WidgetSubtitles.I.DisplaySentence("game_dontwake_intro1");
        //                    break;
        //                case 2:
        //                    WidgetSubtitles.I.DisplaySentence("game_dontwake_intro2");
        //                    break;
        //                case 1:
        //                    WidgetSubtitles.I.DisplaySentence("game_dontwake_intro3");
        //                    break;
        //            }
        //        }

        public void ClickedNext()
        {
            //Debug.Log("ClickedNext()");
            switch (currentState)
            {
            //                case MinigameState.GameIntro:
            //                    if (TutorialIndex > 1) {
            //                        TutorialIndex = TutorialIndex - 1;
            //                        ShowTutorialLine();
            //                    } else {
            //                        GameIntroFinished();
            //                    }
            //                    break;
            case DontWakeUpMinigameState.RoundIntro:
                WidgetSubtitles.I.Close();
                WidgetPopupWindow.I.Show(false);
                currentState = DontWakeUpMinigameState.Playing;
                break;
            }
        }