111 lines
2.8 KiB
C#
Raw Normal View History

2024-12-04 17:26:27 +08:00
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;
2024-12-04 17:26:27 +08:00
private void Awake()
{
ins = this;
OpenForgePanel();
2024-12-04 17:26:27 +08:00
}
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);
2024-12-04 17:26:27 +08:00
}
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);
2024-12-04 17:26:27 +08:00
}
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();
2024-12-04 17:26:27 +08:00
}
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);
}
/// <summary>
/// 战斗过程界面
/// </summary>
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);
2024-12-10 17:46:37 +08:00
combatPanel.StartPanel();
}
public void CloseSwithPanel()
{
swithPanel.gameObject.SetActive(false);
}
public void ResetBattleReadyPanel()
{
battlePanel.ResetReadyPanel();
2024-12-04 17:26:27 +08:00
}
2024-12-10 17:46:37 +08:00
public void OpenRogenPanel()
{
combatPanel.OpenRogenPanel();
}
public void CloseRogenPanel()
{
combatPanel.CloseRogenPanel();
}
2024-12-04 17:26:27 +08:00
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}