Exemplo n.º 1
0
        LoadReturnArgs LoadCommonAsset(ref CommonLoadArgs args, AssetBundleTaskType type = AssetBundleTaskType.Sync | AssetBundleTaskType.LoadAsset)
        {
            if (_assetBundleFeature != null)
            {
                AssetBundleContext context = _assetBundleFeature.StartRead();

                AssetBundleInfo info;
                GameAssetBundle gameAssetBundle;
                if (CanLoad(ref context, args.AssetPath, out info, out gameAssetBundle))
                {
                    AssetBundleTask task = new AssetBundleTask();
                    //
                    task.AssetInfo    = info;
                    task.TaskLoadType = type;
                    task.TaskId       = ++_taskid;
                    task.TaskResType  = TaskResType.Common;
                    task.Priority     = args.Priority;
                    task.CreateTime   = Time.realtimeSinceStartup;

                    //
                    Debug.LogFormat("Task ---- {0} Created", task);

                    context.AddTask(ref task);
                    _assetBundleFeature.EndRead(ref context);

                    LoadReturnArgs returnArgs = new LoadReturnArgs(this._assetBundleFeature, task.TaskId);
                    return(returnArgs);
                }
            }

            return(default(LoadReturnArgs));
        }
Exemplo n.º 2
0
 LoadReturnArgs LoadCommonAsset(CommonLoadArgs args, AssetBundleTaskType type = AssetBundleTaskType.Sync | AssetBundleTaskType.LoadAsset)
 {
     return(LoadCommonAsset(ref args, type));
 }