static int LoadSync(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); XPage obj = (XPage)ToLua.CheckObject(L, 1, typeof(XPage)); System.Action <UnityEngine.GameObject> arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (System.Action <UnityEngine.GameObject>)ToLua.CheckObject(L, 2, typeof(System.Action <UnityEngine.GameObject>)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(System.Action <UnityEngine.GameObject>), func) as System.Action <UnityEngine.GameObject>; } obj.LoadSync(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int LoadSync(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); XPage obj = (XPage)ToLua.CheckObject(L, 1, typeof(XPage)); System.Action <UnityEngine.GameObject> arg0 = (System.Action <UnityEngine.GameObject>)ToLua.CheckDelegate <System.Action <UnityEngine.GameObject> >(L, 2); obj.LoadSync(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <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); }); } } }