/// <summary> /// 打开面板 /// </summary> /// <param name="isSync">是否同步加载</param> /// <param name="pageLoadPath">加载的相对路径</param> public void ShowPage(bool isSync, string pageLoadPath) { string pageName = GetPageName(pageLoadPath); bool isExist = CheckPageExist(pageName); XPage currXPage = null; if (isExist) { currXPage = m_pageDic[pageName]; CheckPageMode(currXPage); currXPage.Rest(); currShowXPage = currXPage; } else { //add currXPage = new XPage(pageName, pageLoadPath); currXPage.Awake(); XPageLoadBind.Bind(currXPage); if (isSync) { currXPage.LoadSync((go) => { CheckPageMode(currXPage); currXPage.Start(); m_pageDic.Add(pageName, currXPage); }); } else { currXPage.LoadAsync((go) => { currXPage.Awake(); CheckPageMode(currXPage); m_pageDic.Add(pageName, currXPage); }); } } }
/// <summary> /// 打开面板 /// </summary> /// <param name="isSync">是否同步加载</param> /// <param name="pageLoadPath">加载的相对路径</param> public void ShowPage(string pageName) { if (string.IsNullOrEmpty(pageName)) { Debug.LogError("pageName--是null"); return; } bool isExist = CheckPageExist(pageName); XPage currXPage = null; if (isExist) { currXPage = m_pageDic[pageName]; if (currXPage.m_currState == EPageState.HIDE) { CheckPageMode(currXPage); currXPage.Rest(); currShowXPage = currXPage; } } else { //add currXPage = new XPage(pageName, ""); currXPage.Awake(); currXPage.LoadAsync(ResManager, o => { m_pageDic.Add(pageName, currXPage); currShowXPage = currXPage; CheckPageMode(currXPage); currXPage.Start(); Debug.LogWarning("CreatePanel::>> " + name + " " + o); }); } }
static int Awake(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); XPage obj = (XPage)ToLua.CheckObject(L, 1, typeof(XPage)); obj.Awake(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }