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(); UIKit.ClosePanel(); UIKit.OpenPanelAsync().ToAction().StartGlobal(); }); Btn2.onClick.RemoveAllListeners(); Btn2.onClick.AddListener(() => { Hide(); TypeEventSystem.Global.Send(); UIKit.ClosePanel(); //先打开loading,遮住 //再来一次加载场景 //UIKit.OpenPanel(); //UIKit.OpenPanelAsync().ToAction().StartGlobal(() => // { UIKit.OpenPanelAsync(canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() => { SceneManager.LoadSceneAsync(Global.Instance.curModule.Scene, LoadSceneMode.Single); var v = UIKit.GetPanel(); SceneManager.sceneLoaded += v.OnLoadFinished; }); // }); }); } protected override void OnHide() { } protected override void OnClose() { } } }