Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (DataManager.isGameStart && Player.isDied)
        {
            CancelInvoke("UpdateScore");
            ResetCamera();
            LineGenerate.ResetLines();
            Player.ResetPlayer();
            DataManager.isGameStart = false;
            //Player.gameObject.SetActive(false);
            UIManager.GameOverSetActive(true);

            UIManager.ScoreText.text = "0";

            if (DataManager.GetScore() < DataManager.score)
            {
                DataManager.SaveScore(DataManager.score);
            }

            DataManager.score = 0;
        }

        if (!Player.isDied)
        {
            //score += 0.01f;
            //DataManager.score += (int)Mathf.Round(score);

            //UIManager.ScoreText.text = DataManager.score.ToString();
        }
    }