147 lines
3.6 KiB
C#
147 lines
3.6 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using WeChatWASM;
|
|
|
|
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;
|
|
[SerializeField] private EndPanel endPanel;
|
|
|
|
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);
|
|
endPanel.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);
|
|
endPanel.gameObject.SetActive(false);
|
|
battlePanel.ResetLevelID();
|
|
}
|
|
|
|
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);
|
|
endPanel.gameObject.SetActive(false);
|
|
drawingPanel.OpenPanel();
|
|
}
|
|
|
|
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);
|
|
endPanel.gameObject.SetActive(false);
|
|
storePanel.StartPanel();
|
|
}
|
|
/// <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);
|
|
endPanel.gameObject.SetActive(false);
|
|
combatPanel.StartPanel();
|
|
}
|
|
|
|
public void OpenEndPanel(bool win)
|
|
{
|
|
endPanel.gameObject.SetActive(true);
|
|
endPanel.SetData(win);
|
|
}
|
|
|
|
public void CloseSwithPanel()
|
|
{
|
|
swithPanel.gameObject.SetActive(false);
|
|
}
|
|
|
|
public void ResetBattleReadyPanel()
|
|
{
|
|
battlePanel.ResetReadyPanel();
|
|
}
|
|
|
|
public void ResetBattlePlayer()
|
|
{
|
|
battlePanel.SetPlayerIndex();
|
|
}
|
|
|
|
public void OpenRogenPanel()
|
|
{
|
|
combatPanel.OpenRogenPanel();
|
|
}
|
|
|
|
public void CloseRogenPanel()
|
|
{
|
|
combatPanel.CloseRogenPanel();
|
|
}
|
|
|
|
public void ResetHp()
|
|
{
|
|
combatPanel.ResetHp();
|
|
combatPanel.ResetItem();
|
|
}
|
|
|
|
public void ResetExp()
|
|
{
|
|
combatPanel.ResetExp();
|
|
}
|
|
|
|
|
|
public void ResetCombatSkill()
|
|
{
|
|
}
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|