Example #1
0
        public void UnloadBundle(string bundleName)
        {
            LevelAssetBundle bundle = null;

            if (bundles.TryGetValue(bundleName, out bundle))
            {
                bundle.Unload();

                bundles.Remove(bundleName);
            }
        }
Example #2
0
        public static T Get <T>(string bundleName, string assetName) where T : class
        {
            LevelAssetBundle bundle = null;

            if (bundles.TryGetValue(bundleName, out bundle))
            {
                return(bundle.GetAsset(assetName) as T);
            }

            bundle = new LevelAssetBundle();
            bundle.Initialize(bundleName);

            bundles.Add(bundleName, bundle);

            return(bundle.GetAsset(assetName) as T);
        }