Exemplo n.º 1
0
 void OnGUI()
 {
     style.fontSize         = 40;
     style.normal.textColor = Color.white;
     GUI.Label(new Rect(50f, 100f, 100f, 50f), "Score: " + scoreTracker.GetScore(), style);
     GUI.Label(new Rect(50f, 50f, 100f, 50f), "Hi-Score: " + scoreTracker.GetHighScore(), style);
 }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        //Saving this from being destroyed on Scene load.
        DontDestroyOnLoad(this.gameObject);
        DontDestroyOnLoad(FindObjectOfType <Camera>());
        //DontDestroyOnLoad(FindObjectOfType<Light>());

        m_menuCanvasGroup.DOFade(1f, 0f);//Activate the UI.

        m_startButton.onClick.AddListener(BeginGame);
        m_highscoreText.text      = "" + m_scoreTracker.GetHighScore();
        SceneManager.sceneLoaded += (e, o) => { ActivateSpawners(); };
    }
Exemplo n.º 3
0
    private void ActivateUI()
    {
        //Save score.
        m_scoreTracker.UpdateHighScore();
        int ourScore  = m_scoreTracker.GetCurrentScore();
        int highscore = m_scoreTracker.GetHighScore();

        m_scoreText.text     = "" + ourScore;
        m_highscoreText.text = "" + highscore;

        m_uiCanvasGroup.DOFade(1f, 1f).OnComplete(() =>
        {
            //Once the UI is visible, we can do stuff.
            m_uiCanvasGroup.interactable = true;
        });
    }