Example #1
0
    private void OnAssetBundleDownloaded_Model(AssetBundle bundle)
    {
        if (bundle != null)
        {
            //加载全部的模型
            string[] bundlenames = bundle.GetAllAssetNames();
            if (bundlenames.Length == 0)
            {
                return;
            }

            for (int i = 0; i < bundlenames.Length; i++)
            {
                GameObject go = (GameObject)Instantiate(bundle.LoadAsset(bundlenames[i]) as GameObject);
                go.name = go.name.Split('(')[0];
                if (go.name != "city")
                {
                    go.transform.SetParent(CarParent);
                }
            }

            //计数
            modelCount++;
            if (modelCount == modelNames.Length)
            {
                // 模型全部加装完毕,配置车辆
                AppDelegate.Instance.OnCarSetting();
            }
            abm.UnloadBundle(bundle);
        }
        abm.Dispose();
    }
Example #2
0
        static int _m_Dispose(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            AssetBundleManager __cl_gen_to_be_invoked = (AssetBundleManager)translator.FastGetCSObj(L, 1);


            try {
                {
                    string sceneName  = LuaAPI.lua_tostring(L, 2);
                    string folderName = LuaAPI.lua_tostring(L, 3);

                    __cl_gen_to_be_invoked.Dispose(sceneName, folderName);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }