static void InternalUnspawn(LoadingTask loadingTask)
 {
     loadingTask.AssetPath       = string.Empty;
     loadingTask.AssetBundleName = string.Empty;
     loadingTask.ScenceName      = string.Empty;
     loadingTask.ResourcesPath   = string.Empty;
 }
 public static void UnspawnLoadingTasks(this List <LoadingTask> loadingTasks)
 {
     for (int i = 0, len = loadingTasks.Count; i < len; i++)
     {
         LoadingTask.Unspawn(loadingTasks[i]);
     }
     loadingTasks.Clear();
 }
        public static List <LoadingTask> SpawnLoadingTasks(this List <string> assetPaths, AssetBundleManifest manifest)
        {
            List <LoadingTask> loadingTasks = new List <LoadingTask>();

            for (int i = 0, len = assetPaths.Count; i < len; i++)
            {
                var assetPath = assetPaths[i];

                string targetName = manifest.GetAssetBundleByAssetPath(assetPath);

                if (!string.IsNullOrEmpty(targetName))
                {
                    LoadingTask lastTask;
                    if (assetPath.IsScenePath())
                    {
                        var scenceName = assetPath.GetScenceName();

                        lastTask = LoadingTask.LoadingSceneFromAssetBundle(scenceName, targetName);
                    }
                    else
                    {
                        lastTask = LoadingTask.LoadingAssetFromAssetBundle(assetPath, targetName);
                    }

                    var assetBundleNames = manifest.GetAllDependencies(targetName, true);

                    assetBundleNames.Reverse();

                    for (int j = 0, len2 = assetBundleNames.Count; j < len2; j++)
                    {
                        loadingTasks.Add(LoadingTask.LoadingAssetBundle(assetBundleNames[j]));
                    }

                    loadingTasks.Add(lastTask);
                }
                else
                {
                    if (assetPath.IsScenePath())
                    {
                        var scenceName = assetPath.GetScenceName();

                        loadingTasks.Add(LoadingTask.LoadingScene(scenceName));
                    }
                    else
                    {
                        var resoucesPath = assetPath.GetResourcesPath();

                        loadingTasks.Add(LoadingTask.LoadingAssetFromResources(assetPath, resoucesPath));
                    }
                }
            }
            return(loadingTasks);
        }
 public static void Unspawn(LoadingTask loadingTask)
 {
     Pool.Unspawn(loadingTask);
 }