using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class UIMgr : MonoBehaviour { public static UIMgr ins; [SerializeField] private ForgePanel forgePanel; [SerializeField] private SwithPanel swithPanel; [SerializeField] private BattlePanel battlePanel; [SerializeField] private DrawingPanel drawingPanel; [SerializeField] private StorePanel storePanel; [SerializeField] private CombatPanel combatPanel; private void Awake() { ins = this; OpenForgePanel(); } public void OpenForgePanel() { forgePanel.gameObject.SetActive(true); swithPanel.gameObject.SetActive(true); battlePanel.gameObject.SetActive(false); drawingPanel.gameObject.SetActive(false); storePanel.gameObject.SetActive(false); combatPanel.gameObject.SetActive(false); } public void OpenBattlePanel() { forgePanel.gameObject.SetActive(false); swithPanel.gameObject.SetActive(true); battlePanel.gameObject.SetActive(true); drawingPanel.gameObject.SetActive(false); storePanel.gameObject.SetActive(false); combatPanel.gameObject.SetActive(false); } public void OpenDrawingPanel() { forgePanel.gameObject.SetActive(false); swithPanel.gameObject.SetActive(true); battlePanel.gameObject.SetActive(false); drawingPanel.gameObject.SetActive(true); storePanel.gameObject.SetActive(false); combatPanel.gameObject.SetActive(false); drawingPanel.Reset(); } public void OpenStorePanel() { forgePanel.gameObject.SetActive(false); swithPanel.gameObject.SetActive(true); battlePanel.gameObject.SetActive(false); drawingPanel.gameObject.SetActive(false); storePanel.gameObject.SetActive(true); combatPanel.gameObject.SetActive(false); storePanel.StartPanel(); } /// /// 战斗过程界面 /// public void OpenCombatPanel() { forgePanel.gameObject.SetActive(false); swithPanel.gameObject.SetActive(false); battlePanel.gameObject.SetActive(false); drawingPanel.gameObject.SetActive(false); storePanel.gameObject.SetActive(false); combatPanel.gameObject.SetActive(true); combatPanel.StartPanel(); } public void CloseSwithPanel() { swithPanel.gameObject.SetActive(false); } public void ResetBattleReadyPanel() { battlePanel.ResetReadyPanel(); } public void OpenRogenPanel() { combatPanel.OpenRogenPanel(); } public void CloseRogenPanel() { combatPanel.CloseRogenPanel(); } public void ResetHp() { combatPanel.ResetHp(); combatPanel.ResetItem(); } public void ResetCombatSkill() { } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } }