Update TipsUI.cs

This commit is contained in:
ALEXTANG
2022-06-07 20:25:03 +08:00
parent 87afe64335
commit 618b15b717

View File

@@ -11,7 +11,7 @@ namespace UI
protected override void RegisterEvent() protected override void RegisterEvent()
{ {
base.RegisterEvent(); base.RegisterEvent();
GameEventMgr.Instance.AddEventListener<string>(TipsEvent.Log, TipsUI.Instance.Show); //GameEventMgr.Instance.AddEventListener<string>(TipsEvent.Log, TipsUI.Instance.Show);
} }
} }
@@ -27,6 +27,15 @@ namespace UI
private void Awake() private void Awake()
{ {
Instance = this; Instance = this;
AvailablePool = new List<GameObject>();
UsedPool = new List<GameObject>();
for (int i = 0; i < 5; i++)
{
AvailablePool.Add(Instantiate(Prefab, Mask.transform));
AvailablePool[i].SetActive(false);
}
GameEventMgr.Instance.AddEventListener<string>(TipsEvent.Log, TipsUI.Instance.Show);
} }
//Prefab //Prefab
public GameObject Prefab; public GameObject Prefab;
@@ -41,13 +50,6 @@ namespace UI
private float timer2; private float timer2;
void Start() void Start()
{ {
AvailablePool = new List<GameObject>();
UsedPool = new List<GameObject>();
for (int i = 0; i < 5; i++)
{
AvailablePool.Add(Instantiate(Prefab, Mask.transform));
AvailablePool[i].SetActive(false);
}
//GameEventMgr.Instance.AddEventListener<string>(TipsEvent.Log, Show); //GameEventMgr.Instance.AddEventListener<string>(TipsEvent.Log, Show);
} }