static int UnloadAssetBundle(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L, 1);
                obj.UnloadAssetBundle();
                return(0);
            }
            else if (count == 2)
            {
                GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L, 1);
                bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
                obj.UnloadAssetBundle(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: GameAsset.LoadedAssetBundle.UnloadAssetBundle"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Beispiel #2
0
 static int QPYX_UnloadAssetBundle_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 1)
         {
             GameAsset.LoadedAssetBundle QPYX_obj_YXQP = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L_YXQP, 1);
             QPYX_obj_YXQP.UnloadAssetBundle();
             return(0);
         }
         else if (QPYX_count_YXQP == 2)
         {
             GameAsset.LoadedAssetBundle QPYX_obj_YXQP = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L_YXQP, 1);
             bool QPYX_arg0_YXQP = LuaDLL.luaL_checkboolean(L_YXQP, 2);
             QPYX_obj_YXQP.UnloadAssetBundle(QPYX_arg0_YXQP);
             return(0);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: GameAsset.LoadedAssetBundle.UnloadAssetBundle"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Beispiel #3
0
 static int QPYX_Reset_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         GameAsset.LoadedAssetBundle QPYX_obj_YXQP = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L_YXQP, 1);
         QPYX_obj_YXQP.Reset();
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static int Reset(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L, 1);
         obj.Reset();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #5
0
 static int QPYX_IsLoadedAll_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         GameAsset.LoadedAssetBundle QPYX_obj_YXQP = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L_YXQP, 1);
         bool QPYX_o_YXQP = QPYX_obj_YXQP.IsLoadedAll();
         LuaDLL.lua_pushboolean(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static int IsLoadedAll(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L, 1);
         bool o = obj.IsLoadedAll();
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int QPYX_LoadAssetBundle_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         GameAsset.AssetBundleManager QPYX_obj_YXQP = (GameAsset.AssetBundleManager)ToLua.CheckObject <GameAsset.AssetBundleManager>(L_YXQP, 1);
         string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 2);
         GameAsset.LoadedAssetBundle QPYX_o_YXQP = QPYX_obj_YXQP.LoadAssetBundle(QPYX_arg0_YXQP);
         ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static int QPYX_RemoveFromLoadedDic_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         GameAsset.AssetBundleManager QPYX_obj_YXQP  = (GameAsset.AssetBundleManager)ToLua.CheckObject <GameAsset.AssetBundleManager>(L_YXQP, 1);
         GameAsset.LoadedAssetBundle  QPYX_arg0_YXQP = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L_YXQP, 2);
         bool QPYX_o_YXQP = QPYX_obj_YXQP.RemoveFromLoadedDic(QPYX_arg0_YXQP);
         LuaDLL.lua_pushboolean(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static int RemoveFromLoadedDic(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         GameAsset.AssetBundleManager obj  = (GameAsset.AssetBundleManager)ToLua.CheckObject <GameAsset.AssetBundleManager>(L, 1);
         GameAsset.LoadedAssetBundle  arg0 = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L, 2);
         bool o = obj.RemoveFromLoadedDic(arg0);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int LoadAssetBundle(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         GameAsset.AssetBundleManager obj = (GameAsset.AssetBundleManager)ToLua.CheckObject <GameAsset.AssetBundleManager>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         GameAsset.LoadedAssetBundle o = obj.LoadAssetBundle(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #11
0
 static int QPYX_GetAsset_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 3);
         GameAsset.LoadedAssetBundle QPYX_obj_YXQP = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L_YXQP, 1);
         string             QPYX_arg0_YXQP         = ToLua.CheckString(L_YXQP, 2);
         bool               QPYX_arg1_YXQP         = LuaDLL.luaL_checkboolean(L_YXQP, 3);
         UnityEngine.Object QPYX_o_YXQP            = QPYX_obj_YXQP.GetAsset(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
         ToLua.Push(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
    static int set_erroMsg(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            string arg0 = ToLua.CheckString(L, 2);
            obj.erroMsg = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index erroMsg on a nil value"));
        }
    }
    static int get_dependAssetBundles(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle   obj = (GameAsset.LoadedAssetBundle)o;
            GameAsset.LoadedAssetBundle[] ret = obj.dependAssetBundles;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index dependAssetBundles on a nil value"));
        }
    }
    static int get_referencedCount(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            int ret = obj.referencedCount;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index referencedCount on a nil value"));
        }
    }
    static int get_erroMsg(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            string ret = obj.erroMsg;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index erroMsg on a nil value"));
        }
    }
 static int QPYX_LoadAssetBundleAsync_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 4);
         GameAsset.AssetBundleManager QPYX_obj_YXQP = (GameAsset.AssetBundleManager)ToLua.CheckObject <GameAsset.AssetBundleManager>(L_YXQP, 1);
         string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 2);
         string QPYX_arg1_YXQP = ToLua.CheckString(L_YXQP, 3);
         System.Action <GameAsset.LoadedAssetBundle> QPYX_arg2_YXQP = (System.Action <GameAsset.LoadedAssetBundle>)ToLua.CheckDelegate <System.Action <GameAsset.LoadedAssetBundle> >(L_YXQP, 4);
         GameAsset.LoadedAssetBundle QPYX_o_YXQP = QPYX_obj_YXQP.LoadAssetBundleAsync(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP);
         ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
    static int get_isStatic(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            bool ret = obj.isStatic;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index isStatic on a nil value"));
        }
    }
    static int get_onLoaded(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            System.Action ret = obj.onLoaded;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onLoaded on a nil value"));
        }
    }
    static int set_isStatic(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.isStatic = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index isStatic on a nil value"));
        }
    }
    static int get_cacheGameObject(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            UnityEngine.GameObject      ret = obj.cacheGameObject;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index cacheGameObject on a nil value"));
        }
    }
    static int set_onLoaded(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            System.Action arg0 = (System.Action)ToLua.CheckDelegate <System.Action>(L, 2);
            obj.onLoaded = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onLoaded on a nil value"));
        }
    }
    static int set_assetObjects(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            System.Collections.Generic.Dictionary <string, UnityEngine.Object> arg0 = (System.Collections.Generic.Dictionary <string, UnityEngine.Object>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.Dictionary <string, UnityEngine.Object>));
            obj.assetObjects = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index assetObjects on a nil value"));
        }
    }
    static int set_referencedCount(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.referencedCount = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index referencedCount on a nil value"));
        }
    }
    static int set_dependAssetBundles(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle   obj  = (GameAsset.LoadedAssetBundle)o;
            GameAsset.LoadedAssetBundle[] arg0 = ToLua.CheckObjectArray <GameAsset.LoadedAssetBundle>(L, 2);
            obj.dependAssetBundles = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index dependAssetBundles on a nil value"));
        }
    }
    static int set_cacheGameObject(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj  = (GameAsset.LoadedAssetBundle)o;
            UnityEngine.GameObject      arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject));
            obj.cacheGameObject = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index cacheGameObject on a nil value"));
        }
    }
 static int GetAsset(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L, 1);
         string             arg0         = ToLua.CheckString(L, 2);
         bool               arg1         = LuaDLL.luaL_checkboolean(L, 3);
         UnityEngine.Object o            = obj.GetAsset(arg0, arg1);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int get_assetObjects(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameAsset.LoadedAssetBundle obj = (GameAsset.LoadedAssetBundle)o;
            System.Collections.Generic.Dictionary <string, UnityEngine.Object> ret = obj.assetObjects;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index assetObjects on a nil value"));
        }
    }
 static int LoadAssetBundleAsync(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         GameAsset.AssetBundleManager obj = (GameAsset.AssetBundleManager)ToLua.CheckObject <GameAsset.AssetBundleManager>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         string arg1 = ToLua.CheckString(L, 3);
         System.Action <GameAsset.LoadedAssetBundle> arg2 = (System.Action <GameAsset.LoadedAssetBundle>)ToLua.CheckDelegate <System.Action <GameAsset.LoadedAssetBundle> >(L, 4);
         GameAsset.LoadedAssetBundle o = obj.LoadAssetBundleAsync(arg0, arg1, arg2);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int UnLoadLoadedAssetBundle(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                GameAsset.AssetBundleManager obj  = (GameAsset.AssetBundleManager)ToLua.CheckObject <GameAsset.AssetBundleManager>(L, 1);
                GameAsset.LoadedAssetBundle  arg0 = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L, 2);
                obj.UnLoadLoadedAssetBundle(arg0);
                return(0);
            }
            else if (count == 3)
            {
                GameAsset.AssetBundleManager obj  = (GameAsset.AssetBundleManager)ToLua.CheckObject <GameAsset.AssetBundleManager>(L, 1);
                GameAsset.LoadedAssetBundle  arg0 = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L, 2);
                bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
                obj.UnLoadLoadedAssetBundle(arg0, arg1);
                return(0);
            }
            else if (count == 4)
            {
                GameAsset.AssetBundleManager obj  = (GameAsset.AssetBundleManager)ToLua.CheckObject <GameAsset.AssetBundleManager>(L, 1);
                GameAsset.LoadedAssetBundle  arg0 = (GameAsset.LoadedAssetBundle)ToLua.CheckObject <GameAsset.LoadedAssetBundle>(L, 2);
                bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
                bool arg2 = LuaDLL.luaL_checkboolean(L, 4);
                obj.UnLoadLoadedAssetBundle(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: GameAsset.AssetBundleManager.UnLoadLoadedAssetBundle"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Beispiel #30
0
        LoadedAssetBundle GetOrGenerateLoadedAssetBundle(string assetBundleName, bool isLoadingAssetBundleManifest, bool asyncLoad)
        {
            LoadedAssetBundle loaded;

            if (mLoadedAssetBundleDic.TryGetValue(assetBundleName, out loaded))
            { //如果AssetBundle已经加载则其引用+1
                ++loaded.referencedCount;
                // 此处只考虑本身是否已加载完成
                if (loaded.isLoaded)
                {
                    //                    Debug.LogError(string.Format("OnLoadAssetBundle 已有对应AssetBundle!!! {0}", assetBundleName));
                    return(loaded);
                }
            }


            if (loaded == null)
            {
                loaded = new LoadedAssetBundle(assetBundleName, asyncLoad);
                AddToLoadedDic(assetBundleName, loaded);
            }

            if (loaded.assetBundle != null)
            {
                Debug.LogError(string.Format("OnLoadAssetBundle 已有对应AssetBundle!!!"));
            }
#if DEBUG
            //            Debug.LogFormat("开始{0}加载:{1} - {2} | {3}", asyncLoad ? "异步" : "同步", Time.frameCount, Time.realtimeSinceStartup, assetBundleName);
#endif
            if (!isLoadingAssetBundleManifest)
            {    //必须要先加载依赖的AssetBundle
                loaded.dependAssetBundles = GetDependAssetBundles(assetBundleName, asyncLoad);
            }
            if (!asyncLoad)
            {
                loaded.assetBundle = LoadAssetBundleFromFile(assetBundleName);
                loaded.isLoaded    = true;
            }
            return(loaded);
        }