using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class PhaseDisplayer : MonoBehaviour { //public BattleManager BattleManager;//在定义单例系统后,BattleManager已经作为静态存在 public Text phaseText; // Start is called before the first frame update void Start() { BattleManager.Instance.phaseChangeEvent.AddListener(UpdateText); } // Update is called once per frame void Update() { //UpdateText(); } public void UpdateText() { phaseText.text = BattleManager.Instance.gamePhase.ToString(); } }