public static SceneAssetRequest LoadSceneAsync(string path, bool additive) { if (string.IsNullOrEmpty(path)) { Debug.LogError("invalid path"); return(null); } path = GetExistPath(path); var asset = new SceneAssetAsyncRequest(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); }
public static SceneAssetRequest LoadSceneAsync(string path, bool additive) { var asset = new SceneAssetAsyncRequest(path, additive); asset.Load(); asset.Retain(); _scenes.Add(asset); return(asset); }
static int get_isDone(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); libx.SceneAssetAsyncRequest obj = (libx.SceneAssetAsyncRequest)o; bool ret = obj.isDone; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index isDone on a nil value")); } }
static int get_progress(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); libx.SceneAssetAsyncRequest obj = (libx.SceneAssetAsyncRequest)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")); } }
public static SceneAssetRequest LoadSceneAsync(string path, bool additive = false) { Assert.IsNotNull(path, "path != null"); string assetBundleName; path = GetSearchPath(path, out assetBundleName); var asset = new SceneAssetAsyncRequest(path, additive) { assetBundleName = assetBundleName }; Log(string.Format("LoadSceneAsync:{0}", path)); asset.Load(); asset.Retain(); asset.name = path; LoadingScenes.Add(asset); if (!additive) { if (_runningScene != null) { _runningScene.Release(); _runningScene = null; } _runningScene = asset; } else { if (_runningScene != null) { _runningScene.additives.Add(asset); } } return(asset); }
static int _Createlibx_SceneAssetAsyncRequest(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.SceneAssetAsyncRequest obj = new libx.SceneAssetAsyncRequest(arg0, arg1); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: libx.SceneAssetAsyncRequest.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }