如图所示 :
// Resources 加载
UIKit.OpenPanel("Resources/UIPrefab/UIMenuPanel");
// Resources 加载并传递数据
UIKit.OpenPanel<UIMenuPanel>(new UIMenuPanelData() { m_Modle = this.m_Modle }, prefabName: "UIPrefab/UIMenuPanel");
//AB方式加载
UIKit.OpenPanel<UIMenuPanel>();
using QFramework;
using QFramework.Example;
using System.Collections;
using UnityEngine;public class AppStart : MonoSingleton<AppStart>
{public MyModle m_Modle;private IEnumerator Start(){// 打包分辨率设置UIRoot uiroot = UIRoot.Instance;uiroot.SetResolution(Screen.width, Screen.height, 1);yield return new WaitForSeconds(0.2f);m_Modle = new MyModle() { Mode = new FSM<GameMode>() };Resources 加载//UIKit.OpenPanel("Resources/UIPrefab/UIMenuPanel");// Resources 加载并传递数据UIKit.OpenPanel<UIMenuPanel>(new UIMenuPanelData() { m_Modle = this.m_Modle }, prefabName: "UIPrefab/UIMenuPanel");AB方式加载//UIKit.OpenPanel<UIMenuPanel>();}
}
public enum GameMode
{IPAD,VISITERSCN,VISITERSEN
}public class MyModle
{//FSM 状态机public FSM<GameMode> Mode;
}