Example #1
0
        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);
        }
Example #2
0
    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));
        }
    }
Example #3
0
 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));
     }
 }
Example #4
0
    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"));
        }
    }
Example #5
0
    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"));
        }
    }
Example #6
0
    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"));
        }
    }
Example #7
0
    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"));
        }
    }
Example #8
0
    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"));
        }
    }
Example #9
0
    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"));
        }
    }
Example #10
0
    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));
        }
    }
Example #11
0
 public static void UnloadScene(SceneAssetRequest scene)
 {
     scene.Release();
 }
Example #12
0
 public void Unload()
 {
     request.Unload();
     request = null;
 }
Example #13
0
 public void Load()
 {
     request = Assets.LoadSceneAsync(url, isAdditive);
 }