Merge branch 'temp827'
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
using System;
|
||||
using Base;
|
||||
using Map;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI
|
||||
@ -6,7 +10,13 @@ namespace UI
|
||||
{
|
||||
[SerializeField] private BarUI focusedEntityHP;
|
||||
[SerializeField] private BarUI lastEntityHP;
|
||||
|
||||
[SerializeField] private BarUI BaseBuildingHP;
|
||||
[SerializeField] private MiniMap miniMap;
|
||||
[SerializeField] private EquipmentUI equipmentUI;
|
||||
[SerializeField] private CoinCountUI coinCountUI;
|
||||
[SerializeField] private BuffIconListUI focuseEntityBuffIconList;
|
||||
[SerializeField] private BuffIconListUI lastEntityBuffIconList;
|
||||
[SerializeField] private AttackModeUI attackMode;
|
||||
|
||||
public void Tick()
|
||||
{
|
||||
@ -18,5 +28,52 @@ namespace UI
|
||||
}
|
||||
}
|
||||
|
||||
public void Show()
|
||||
{
|
||||
focusedEntityHP.gameObject.SetActive(true);
|
||||
lastEntityHP.gameObject.SetActive(true);
|
||||
BaseBuildingHP.gameObject.SetActive(true);
|
||||
miniMap.gameObject.SetActive(true);
|
||||
equipmentUI.gameObject.SetActive(true);
|
||||
coinCountUI.gameObject.SetActive(true);
|
||||
focuseEntityBuffIconList.gameObject.SetActive(true);
|
||||
lastEntityBuffIconList.gameObject.SetActive(true);
|
||||
attackMode.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void Hide()
|
||||
{
|
||||
focusedEntityHP.gameObject.SetActive(false);
|
||||
lastEntityHP.gameObject.SetActive(false);
|
||||
BaseBuildingHP.gameObject.SetActive(false);
|
||||
miniMap.gameObject.SetActive(false);
|
||||
equipmentUI.gameObject.SetActive(false);
|
||||
coinCountUI.gameObject.SetActive(false);
|
||||
focuseEntityBuffIconList.gameObject.SetActive(false);
|
||||
lastEntityBuffIconList.gameObject.SetActive(false);
|
||||
attackMode.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
UIInputControl.Instance.OnWindowVisibilityChanged += UIChange;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
UIInputControl.Instance.OnWindowVisibilityChanged -= UIChange;
|
||||
}
|
||||
|
||||
private void UIChange(UIBase ui, bool open)
|
||||
{
|
||||
if (ui.exclusive && open)
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user