4-1) Displaying Score on Screen

시그니천·2024년 6월 5일

[ G01 ] ZigZagRacer

목록 보기
15/26

1. GameManager

  • Score추가
  • UpdateScore() 추가
    private int score = 0;
    public void GameStart()
    {
        gameStarted = true;
        platformSpawner.SetActive(true);

        StartCoroutine(UpdateScore());
    }
    IEnumerator UpdateScore()
    {
        while(true)
        {
            yield return new WaitForSeconds(1f);
            score++;
            print(score);
        }
    }
profile
우주최강개발자

0개의 댓글