2024-12-04 17:26:27 +08:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
2024-12-21 14:05:40 +08:00
|
|
|
using WeChatWASM;
|
2024-12-04 17:26:27 +08:00
|
|
|
|
|
|
|
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;
|
2024-12-07 22:30:19 +08:00
|
|
|
[SerializeField] private CombatPanel combatPanel;
|
2024-12-13 20:38:15 +08:00
|
|
|
[SerializeField] private EndPanel endPanel;
|
2024-12-24 17:05:51 +08:00
|
|
|
[SerializeField] private GuidePanel guidePanel;
|
2024-12-04 17:26:27 +08:00
|
|
|
|
|
|
|
private void Awake()
|
2024-12-23 17:12:52 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Init()
|
2024-12-04 17:26:27 +08:00
|
|
|
{
|
|
|
|
ins = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OpenForgePanel()
|
|
|
|
{
|
|
|
|
forgePanel.gameObject.SetActive(true);
|
|
|
|
swithPanel.gameObject.SetActive(true);
|
|
|
|
battlePanel.gameObject.SetActive(false);
|
|
|
|
drawingPanel.gameObject.SetActive(false);
|
|
|
|
storePanel.gameObject.SetActive(false);
|
2024-12-07 22:30:19 +08:00
|
|
|
combatPanel.gameObject.SetActive(false);
|
2024-12-13 20:38:15 +08:00
|
|
|
endPanel.gameObject.SetActive(false);
|
2024-12-23 17:12:52 +08:00
|
|
|
forgePanel.Close();
|
2024-12-24 17:05:51 +08:00
|
|
|
swithPanel.SetIndex(2);
|
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);
|
2024-12-07 22:30:19 +08:00
|
|
|
combatPanel.gameObject.SetActive(false);
|
2024-12-13 20:38:15 +08:00
|
|
|
endPanel.gameObject.SetActive(false);
|
2024-12-22 20:35:00 +08:00
|
|
|
battlePanel.ResetLevelID();
|
2024-12-24 17:05:51 +08:00
|
|
|
if (DataManager.GetPrefab("firstGuideV2")!=1)
|
|
|
|
{
|
|
|
|
guidePanel.gameObject.SetActive(true);
|
|
|
|
guidePanel.Event7();
|
|
|
|
}
|
|
|
|
swithPanel.SetIndex(3);
|
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);
|
2024-12-07 22:30:19 +08:00
|
|
|
combatPanel.gameObject.SetActive(false);
|
2024-12-13 20:38:15 +08:00
|
|
|
endPanel.gameObject.SetActive(false);
|
2024-12-16 17:25:10 +08:00
|
|
|
drawingPanel.OpenPanel();
|
2024-12-24 17:05:51 +08:00
|
|
|
swithPanel.SetIndex(1);
|
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);
|
2024-12-07 22:30:19 +08:00
|
|
|
combatPanel.gameObject.SetActive(false);
|
2024-12-13 20:38:15 +08:00
|
|
|
endPanel.gameObject.SetActive(false);
|
2024-12-11 13:58:55 +08:00
|
|
|
storePanel.StartPanel();
|
2024-12-24 17:05:51 +08:00
|
|
|
swithPanel.SetIndex(0);
|
2024-12-07 22:30:19 +08:00
|
|
|
}
|
|
|
|
/// <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-13 20:38:15 +08:00
|
|
|
endPanel.gameObject.SetActive(false);
|
2024-12-10 17:46:37 +08:00
|
|
|
combatPanel.StartPanel();
|
2024-12-07 22:30:19 +08:00
|
|
|
}
|
|
|
|
|
2024-12-13 20:38:15 +08:00
|
|
|
public void OpenEndPanel(bool win)
|
|
|
|
{
|
|
|
|
endPanel.gameObject.SetActive(true);
|
|
|
|
endPanel.SetData(win);
|
|
|
|
}
|
|
|
|
|
2024-12-07 22:30:19 +08:00
|
|
|
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
|
|
|
|
2024-12-13 20:38:15 +08:00
|
|
|
public void ResetBattlePlayer()
|
|
|
|
{
|
|
|
|
battlePanel.SetPlayerIndex();
|
|
|
|
}
|
|
|
|
|
2024-12-10 17:46:37 +08:00
|
|
|
public void OpenRogenPanel()
|
|
|
|
{
|
|
|
|
combatPanel.OpenRogenPanel();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void CloseRogenPanel()
|
|
|
|
{
|
|
|
|
combatPanel.CloseRogenPanel();
|
|
|
|
}
|
2024-12-11 13:58:55 +08:00
|
|
|
|
|
|
|
public void ResetHp()
|
|
|
|
{
|
|
|
|
combatPanel.ResetHp();
|
2024-12-11 20:35:20 +08:00
|
|
|
combatPanel.ResetItem();
|
|
|
|
}
|
|
|
|
|
2024-12-13 20:38:15 +08:00
|
|
|
public void ResetExp()
|
|
|
|
{
|
|
|
|
combatPanel.ResetExp();
|
|
|
|
}
|
|
|
|
|
2024-12-24 17:05:51 +08:00
|
|
|
public void OpenFirstGuidePanel()
|
|
|
|
{
|
|
|
|
guidePanel.gameObject.SetActive(true);
|
|
|
|
guidePanel.GLock1();
|
|
|
|
}
|
|
|
|
public void OpenFirstGuidePanelv3()
|
|
|
|
{
|
|
|
|
guidePanel.gameObject.SetActive(true);
|
|
|
|
guidePanel.Event13();
|
|
|
|
}
|
2024-12-11 20:35:20 +08:00
|
|
|
public void ResetCombatSkill()
|
|
|
|
{
|
2024-12-11 13:58:55 +08:00
|
|
|
}
|
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()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|