DESKTOP-DDTRVOR\asus 36fa2e1e12 修改声音
2024-12-26 11:39:49 +08:00

172 lines
4.3 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;
[SerializeField] private GuidePanel guidePanel;
private void Awake()
{
}
public void Init()
{
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);
combatPanel.gameObject.SetActive(false);
endPanel.gameObject.SetActive(false);
forgePanel.Close();
swithPanel.SetIndex(2);
SoundSystem.ins.MainAudio();
}
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();
if (DataManager.GetPrefab("firstGuideV2")!=1)
{
guidePanel.gameObject.SetActive(true);
guidePanel.Event7();
}
swithPanel.SetIndex(3);
}
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();
swithPanel.SetIndex(1);
}
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();
swithPanel.SetIndex(0);
}
/// <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 OpenFirstGuidePanel()
{
guidePanel.gameObject.SetActive(true);
guidePanel.GLock1();
}
public void OpenFirstGuidePanelv3()
{
guidePanel.gameObject.SetActive(true);
guidePanel.Event13();
}
public void ResetCombatSkill()
{
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}