Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        totalScoreText = FindObjectOfType <TotalScoreUI>().GetComponent <TMP_Text>();
        highScoreText  = FindObjectOfType <HighScoreUI>().GetComponent <TMP_Text>();

        pss = this;
    }
        public GameplayScene() : base("GameScene")
        {
            GridNode               = new GridNode();
            GameTimer              = new GameTimer();
            GameTimer.TimeEnded   += OnGameTimeEnds;
            PlayerScoreSystem      = new PlayerScoreSystem();
            GridNode.OnScoreAdded += PlayerScoreSystem.AddScore;

            AddChild(PlayerScoreSystem);
            AddChild(GridNode);
            AddChild(GameTimer);
        }
Beispiel #3
0
    public void CheckForUpdate()
    {
        if (previousCurrent != currentScore)
        {
            Mathf.RoundToInt(currentScore);

            if (pSS == null)
            {
                pSS = FindObjectOfType <PlayerScoreSystem>();
            }

            pSS.AddToTotal(currentScore - previousCurrent, currentScore);
            previousCurrent = currentScore;
        }
    }
 private void Start()
 {
     player            = GameObject.FindWithTag("Player");
     playerScoreSystem = player.GetComponent <PlayerScoreSystem>();
     textMesh          = GetComponent <TextMeshProUGUI>();
 }
 private void Start()
 {
     player            = GameObject.FindWithTag("Player");
     lava              = GameObject.FindWithTag("Lava");
     playerScoreSystem = player.GetComponent <PlayerScoreSystem>();
 }