static int _m_LoadAssetBundle_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    string          name     = LuaAPI.lua_tostring(L, 1);
                    LoadingCallback callback = translator.GetDelegate <LoadingCallback>(L, 2);

                    BoyApp.LoadAssetBundle(name, callback);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
示例#2
0
    public static void LoadAssetBundleAndAllDependencies(string name, LoadingCallback callback)
    {
        string[] loadingDps = BoyApp.manifest.GetAllDependencies(name);

        List <string> needLoading = new List <string>();

        foreach (var key in loadingDps)
        {
            needLoading.Add(key);
            BoyApp.LoadAssetBundle(key, (System.Object asset) => {
                needLoading.Remove(key);

                if (needLoading.Count == 0)
                {
                    BoyApp.LoadAssetBundle(name, callback);
                }
            });
        }

        if (loadingDps.Length == 0)
        {
            BoyApp.LoadAssetBundle(name, callback);
        }
    }