VirtualFramework/Assets/Scripts/UI/UITipWindowResetModule.cs

73 lines
2.0 KiB
C#
Raw Normal View History

using UnityEngine;
using UnityEngine.UI;
using QFramework;
using System;
using UnityEngine.SceneManagement;
namespace QFramework.Example
{
public class UITipWindowResetModuleData : UIPanelData
{
}
public partial class UITipWindowResetModule : UIPanel
{
protected override void OnInit(IUIData uiData = null)
{
mData = uiData as UITipWindowResetModuleData ?? new UITipWindowResetModuleData();
// please add init code here
}
protected override void OnOpen(IUIData uiData = null)
{
}
protected override void OnShow()
{
Btn1.onClick.RemoveAllListeners();
Btn1.onClick.AddListener(() =>
{
Hide();
TypeEventSystem.Global.Send<OnModuleQuit>();
UIKit.ClosePanel<UIRightTop>();
UIKit.OpenPanelAsync<UIModeSelect>().ToAction().StartGlobal();
});
Btn2.onClick.RemoveAllListeners();
Btn2.onClick.AddListener(() =>
{
Hide();
TypeEventSystem.Global.Send<OnModuleQuit>();
UIKit.ClosePanel<UIRightTop>();
//<2F>ȴ<EFBFBD><C8B4><EFBFBD>loading<6E><67><EFBFBD><EFBFBD>ס
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD>μ<EFBFBD><CEBC>س<EFBFBD><D8B3><EFBFBD>
//UIKit.OpenPanel<UILoading>();
//UIKit.OpenPanelAsync<UIModuleSelect>().ToAction().StartGlobal(() =>
// {
UIKit.OpenPanelAsync<UILoading>(canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() =>
{
SceneManager.LoadSceneAsync(Global.Instance.curModule.Scene, LoadSceneMode.Single);
var v = UIKit.GetPanel<UIModuleSelect>();
SceneManager.sceneLoaded += v.OnLoadFinished;
});
// });
});
}
protected override void OnHide()
{
}
protected override void OnClose()
{
}
}
}