HunterGameView.cs 658 B

123456789101112131415161718192021222324252627
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class HunterGameView : MonoBehaviour
  6. {
  7. Text t1;
  8. Text t2;
  9. RabbitHuntGameMode gameMode;
  10. void Start()
  11. {
  12. t1 = this.transform.Find("T1").GetComponent<Text>();
  13. t2 = this.transform.Find("T2").GetComponent<Text>();
  14. gameMode = (RabbitHuntGameMode) GameMgr.ins.gameMode;
  15. }
  16. void FixedUpdate()
  17. {
  18. t1.text = "剩余野兔:" + gameMode.GetSurplusAnimalCount();
  19. t2.text = gameMode.GetTimeStr();
  20. if (GameMgr.ins.gameOver) {
  21. Destroy(this.gameObject);
  22. }
  23. }
  24. }