VirtualFramework/Assets/Scripts/UI/UITipWindowResetModule.cs

73 lines
2.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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()
{
}
}
}