73 lines
2.0 KiB
C#
73 lines
2.0 KiB
C#
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>();
|
||
//先打开loading,遮住
|
||
//再来一次加载场景
|
||
//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()
|
||
{
|
||
}
|
||
}
|
||
} |