Beispiel #1
0
    public static void TurnOnOff(bool setActive, string gameState = "GAME OVER")
    {
        BeatManager.StopMusic();
        instance.gameObject.SetActive(setActive);
        instance.enabled = true;
        Debug.Log("We are scoreer");
        if (setActive)
        {
            //FindObjectOfType<PlayerEngine>().gameObject.SetActive(false);

            BeatManager.StopMusic();
            RoundController.PauseRound(true);
            instance.gameState.text     = gameState;
            instance.CurrentScore.text  = StreakCounterUI.scoreToPrint.ToString();
            instance.EnemyKills.text    = RoundController.EnemiesKilled.ToString();
            instance.SyncedHits.text    = StreakCounterUI.HitsOnBeat.ToString();
            instance.BestHitStreak.text = StreakCounterUI.TopHitsInArow.ToString();
            instance.Deaths.text        = StreakCounterUI.DeathCount.ToString();

            instance.scoreToPrintScore  = StreakCounterUI.scoreToPrint;
            instance.topHitsScore       = StreakCounterUI.TopHitsInArow; //
            instance.enemiesKileldScore = RoundController.EnemiesKilled; //
            instance.hitsOnBeatScore    = StreakCounterUI.HitsOnBeat;    //
            instance.deathcountScore    = StreakCounterUI.DeathCount;    //
            instance.Invoke("CalculateScore", 0.5f);
        }
    }
Beispiel #2
0
    private void GameOver()
    {
        CoreHealth.Instance.coreDied -= GameOver;
        BeatManager.StopMusic();
        HUDManager hud = FindObjectOfType <HUDManager>();

        if (hud)
        {
            hud.gameObject.SetActive(false);
        }

        gameOver = true;
        PlayableDirector director = FindObjectOfType <PlayableDirector>();

        director.enabled       = true;
        director.playableAsset = gameOverCinematic;
        director.Play();
        director.stopped += ShowScoreScreen;
        Transform parent = FindObjectOfType <CameraController>().transform.GetChild(0).transform;

        if (parent)
        {
            for (int i = 0; i < parent.childCount; i++)
            {
                parent.GetChild(i).gameObject.SetActive(false);
            }
        }
    }
Beispiel #3
0
    public override void Back()
    {
        BeatManager.StopMusic();
        MenuManager.Instance.CloseAllMenus();
        GameObject go = MenuManager.Instance.gameObject;

        Destroy(go);
        int sceneToMoveTo = SceneManager.GetActiveScene().buildIndex - 1;

        if (sceneToMoveTo >= 0)
        {
            SceneManager.LoadScene(sceneToMoveTo);
        }
        else
        {
            UnityEngine.Debug.Log("There is no scene assigned in build settings!");
        }
    }