Ejemplo n.º 1
0
 protected override void OnUnload()
 {
     if (Bundle_ != null)
     {
         Bundle_.Unload(true);
         Bundle_ = null;
     }
 }
Ejemplo n.º 2
0
 public void Release()
 {
     RefCount--;
     if (RefCount <= 0 && Bundle)
     {
         Bundle.Unload(true);
         Bundle = null;
     }
 }
Ejemplo n.º 3
0
        static StackObject *Unload_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @unloadAllLoadedObjects = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.AssetBundle instance_of_this_method = (UnityEngine.AssetBundle) typeof(UnityEngine.AssetBundle).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Unload(@unloadAllLoadedObjects);

            return(__ret);
        }
Ejemplo n.º 4
0
        static int _m_Unload(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.AssetBundle __cl_gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);


            try {
                {
                    bool unloadAllLoadedObjects = LuaAPI.lua_toboolean(L, 2);

                    __cl_gen_to_be_invoked.Unload(unloadAllLoadedObjects);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Ejemplo n.º 5
0
        private static void MenuItem_CreateAssetBundleWithAssetsPath()
        {
            //事前処理。
            {
                BlueBack.AssetLib.Editor.DeleteDirectoryWithAssetsPath.TryDelete("Out/AssetBundleIn");
                BlueBack.AssetLib.Editor.DeleteDirectoryWithAssetsPath.TryDelete("Out/AssetBundleOut");
                BlueBack.AssetLib.Editor.CreateDirectoryWithAssetsPath.Create("Out/AssetBundleIn");
                BlueBack.AssetLib.Editor.CreateDirectoryWithAssetsPath.Create("Out/AssetBundleOut");
                BlueBack.AssetLib.Editor.SaveTextWithAssetsPath.SaveNoBomUtf8("text", "Out/AssetBundleIn/text.txt", BlueBack.AssetLib.LineFeedOption.CRLF);
                BlueBack.AssetLib.Editor.RefreshAssetDatabase.Refresh();
            }

            //CreateAssetBundleWithAssetsPath
            {
                BlueBack.AssetLib.Editor.CreateAssetBundleWithAssetsPath.Create(
                    "Out/AssetBundleOut",
                    new UnityEditor.AssetBundleBuild[] {
                    new UnityEditor.AssetBundleBuild()
                    {
                        assetBundleName    = "test.assetbundle",
                        assetBundleVariant = null,
                        assetNames         = new string[] { "Assets/Out/AssetBundleIn/text.txt" },
                        addressableNames   = null,
                    }
                },
                    UnityEditor.BuildAssetBundleOptions.None,
                    UnityEditor.EditorUserBuildSettings.activeBuildTarget
                    );
                BlueBack.AssetLib.Editor.RefreshAssetDatabase.Refresh();
            }

            //ログ。
            {
                UnityEngine.AssetBundle t_assetbundle = UnityEngine.AssetBundle.LoadFromFile("Assets/Out/AssetBundleOut/test.assetbundle");
                UnityEngine.Debug.Log(t_assetbundle.LoadAsset <UnityEngine.TextAsset>("text").text);
                t_assetbundle.Unload(false);
            }
        }