public void Init() { switch (lanuchType) { case LaunchType.Debug: DebugLaunch(); break; case LaunchType.Release: ReleaseLaunch(); break; } ModuleManager.Instance.Init("Project"); //InitModule SingletonMono <ResourcesMgr> .Create(); ScenesManager.Instance.Init("Scene/Example/"); ScenesManager.MainScene = SceneExampleDef.Example; ScenesManager.Instance.LoadScene(SceneExampleDef.LoadOK); UIManager.Instance.Init("UI/Example/"); UIManager.MainPage = "UIPage1"; UIManager.Instance.EnterMainPage(); DontDestroyOnLoad(gameObject); }
private List <UIPanel> m_listLoadedPanel; //所有加载过的页面 /// <summary> /// 初始化操作 /// </summary> /// <param name="uiResRoot">UI资源的根目录,默认为"UI/"</param> public void Init(string uiResRoot = "UI/") { CheckSingleton(); UIRes.UIResRoot = uiResRoot; m_pageTrackStack = new Stack <UIPageTrack>(); m_listLoadedPanel = new List <UIPanel>(); SingletonMono <UIComponent> .Create(); }
public static void InitBuiltinComponents() { //Init Module ModuleManager.Instance.Init("Project"); //InitTick TickManager.Instance.Init(); //Init Console Console.Console.Create(); //Init FSM FSMManager.Instance.Init(); //InitConfig AppConfig.Init(); //InitModule //Init Resources SingletonMono <ResourcesMgr.ResourcesMgr> .Create(); //Init Scene ScenesManager.Instance.Init("Scene/"); ScenesManager.MainScene = SceneDef.HomeScene; if (lanuchType == LaunchType.Debug && !string.IsNullOrEmpty(startScene)) { ScenesManager.Instance.LoadScene(startScene); } //Init UI UIManager.Instance.Init("UI/"); UIManager.MainPage = UIDef.MainPage; if (lanuchType == LaunchType.Debug && !string.IsNullOrEmpty(startUI)) { UIManager.Instance.OpenPage(startUI, null); } //Init Audio AudioManager.Instance.Init("Audio/"); if (lanuchType == LaunchType.Debug && !string.IsNullOrEmpty(startAudio)) { AudioManager.Instance.PlayBGM(AudioDef.BGM_MainBGM, 0.2f); } }