public static SceneAssetRequest LoadSceneAsync(string path, bool additive) { if (string.IsNullOrEmpty(path)) { Debug.LogError("invalid path"); return(null); } path = GetExistPath(path); var asset = new SceneAssetRequest(path, additive); if (!additive) { if (_runningScene != null) { _runningScene.Release();; _runningScene = null; } _runningScene = asset; } asset.Load(); asset.Retain(); _scenes.Add(asset); Log(string.Format("LoadScene:{0}", path)); return(asset); }
static int LoadSceneAsync(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 1) { string arg0 = ToLua.CheckString(L, 1); libx.SceneAssetRequest o = libx.Assets.LoadSceneAsync(arg0); ToLua.PushObject(L, o); return(1); } else if (count == 2) { string arg0 = ToLua.CheckString(L, 1); bool arg1 = LuaDLL.luaL_checkboolean(L, 2); libx.SceneAssetRequest o = libx.Assets.LoadSceneAsync(arg0, arg1); ToLua.PushObject(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: libx.Assets.LoadSceneAsync")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int UnloadScene(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); libx.SceneAssetRequest arg0 = (libx.SceneAssetRequest)ToLua.CheckObject <libx.SceneAssetRequest>(L, 1); libx.Assets.UnloadScene(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_assetBundleName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); libx.SceneAssetRequest obj = (libx.SceneAssetRequest)o; string ret = obj.assetBundleName; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index assetBundleName on a nil value")); } }
static int get_additives(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); libx.SceneAssetRequest obj = (libx.SceneAssetRequest)o; System.Collections.Generic.List <libx.SceneAssetRequest> ret = obj.additives; ToLua.PushSealed(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index additives on a nil value")); } }
static int set_additives(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); libx.SceneAssetRequest obj = (libx.SceneAssetRequest)o; System.Collections.Generic.List <libx.SceneAssetRequest> arg0 = (System.Collections.Generic.List <libx.SceneAssetRequest>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <libx.SceneAssetRequest>)); obj.additives = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index additives on a nil value")); } }
static int get_loadSceneMode(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); libx.SceneAssetRequest obj = (libx.SceneAssetRequest)o; UnityEngine.SceneManagement.LoadSceneMode ret = obj.loadSceneMode; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index loadSceneMode on a nil value")); } }
static int set_assetBundleName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); libx.SceneAssetRequest obj = (libx.SceneAssetRequest)o; string arg0 = ToLua.CheckString(L, 2); obj.assetBundleName = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index assetBundleName on a nil value")); } }
static int get_progress(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); libx.SceneAssetRequest obj = (libx.SceneAssetRequest)o; float ret = obj.progress; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index progress on a nil value")); } }
static int _Createlibx_SceneAssetRequest(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { string arg0 = ToLua.CheckString(L, 1); bool arg1 = LuaDLL.luaL_checkboolean(L, 2); libx.SceneAssetRequest obj = new libx.SceneAssetRequest(arg0, arg1); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: libx.SceneAssetRequest.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public static void UnloadScene(SceneAssetRequest scene) { scene.Release(); }
public void Unload() { request.Unload(); request = null; }
public void Load() { request = Assets.LoadSceneAsync(url, isAdditive); }