Beispiel #1
0
    IEnumerator Example()
    {
        GameOverScript gos = gameOverPanel.GetComponent <GameOverScript>();

        //   gos.GetHighscores();

        Time.timeScale = 0;
        yield return(new WaitForSecondsRealtime(1.5f));

        //gameOverPanel.SetActive(true);
        black.CrossFadeAlpha(1.0f, 1, true);
        yield return(new WaitForSecondsRealtime(2.0f));

        //  prompt.SetActive(true);


        int isHighScore = gos.CheckIfHighscore(GameObject.FindGameObjectWithTag("Player").GetComponent <BeeManager>().CurrentScore);

        print(isHighScore);
        if (isHighScore == 1)
        {
            prompt.SetActive(true);
            prompt.GetComponentsInChildren <InputField>()[0].ActivateInputField();
            yield return(new WaitUntil(() => !prompt.activeInHierarchy));
        }



        highscore.SetActive(true);
        yield return(new WaitUntil(() => Input.GetKeyDown("return")));

        Time.timeScale = 1;
        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }