ScoreManager.cs 446 B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. public class ScoreManager : MonoBehaviour
  5. {
  6. public static int score;
  7. Text text;
  8. public Text dieText;
  9. void Awake ()
  10. {
  11. text = GetComponent <Text> ();
  12. score = 0;
  13. }
  14. void Update ()
  15. {
  16. text.text = "Score: " + score;
  17. dieText.text = "目前得分:<size=14><color=#00FFEA>" + score + "</color></size>";
  18. }
  19. }