Ejemplo n.º 1
0
 internal override void Load()
 {
     if (!string.IsNullOrEmpty(assetBundleName))
     {
         bundleRequest = AssetsManger.LoadBundle(assetBundleName);
         if (bundleRequest != null)
         {
             SceneManager.LoadScene(sceneName, loadSceneMode);
         }
     }
     else
     {
         try
         {
             SceneManager.LoadScene(sceneName, loadSceneMode);
             loadState = LoadState.LoadAsset;
         }
         catch (Exception e)
         {
             Log.Error(e);
             error     = e.ToString();
             loadState = LoadState.Loaded;
         }
     }
 }
Ejemplo n.º 2
0
 internal override void Unload()
 {
     if (_request != null)
     {
         _request.Release();
         _request = null;
     }
 }
Ejemplo n.º 3
0
 internal override void Unload()
 {
     if (bundleRequest != null)
     {
         bundleRequest.Release();
         bundleRequest = null;
     }
     asset = null;
 }
Ejemplo n.º 4
0
 internal static void UnloadDependencies(BundleRequest request)
 {
     for (var i = 0; i < request.dependencies.Count; i++)
     {
         var item = request.dependencies[i];
         item.Release();
     }
     request.dependencies.Clear();
 }
Ejemplo n.º 5
0
 internal override void Load()
 {
     _assetName = Path.GetFileNameWithoutExtension(url);
     if (GameUtility.Assets.runtimeMode)
     {
         _request           = AssetsManger.LoadBundle(_assetName.ToLower(), true);
         _request.completed = Request_completed;
         loadState          = LoadState.LoadAssetBundle;
     }
     else
     {
         loadState = LoadState.Loaded;
     }
 }
Ejemplo n.º 6
0
        internal static void LoadDependencies(BundleRequest request, string assetBundleName, bool async)
        {
            var dependencies = GetAllDependencies(assetBundleName);

            if (dependencies.Length <= 0)
            {
                return;
            }
            for (var i = 0; i < dependencies.Length; i++)
            {
                var item = dependencies[i];
                request.dependencies.Add(LoadBundle(item, async));
            }
        }
Ejemplo n.º 7
0
 internal override void Unload()
 {
     if (bundleRequest != null)
     {
         bundleRequest.Release();
     }
     if (loadSceneMode == LoadSceneMode.Additive)
     {
         if (SceneManager.GetSceneByName(sceneName).isLoaded)
         {
             SceneManager.UnloadSceneAsync(sceneName);
         }
     }
     bundleRequest = null;
 }
Ejemplo n.º 8
0
 void ReleaseByBundle(BundleRequest bundle)
 {
     if (bundle.url.Equals(url))
     {
         base.Release();
         return;
     }
     if (_parents.Contains(bundle))
     {
         return;
     }
     _parents.Add(bundle);
     foreach (var child in bundle.dependencies)
     {
         ReleaseByBundle(child);
     }
 }
Ejemplo n.º 9
0
 internal static void UnloadBundle(BundleRequest bundle)
 {
     bundle.Release();
 }