示例#1
0
        LoadReturnArgs PreLoadAsset(ref PreLoadArgs args, AssetBundleTaskType type = AssetBundleTaskType.Sync | AssetBundleTaskType.PreLoadAsset)
        {
            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.GameObject;
                    task.Priority     = args.Priority;
                    task.CreateTime   = Time.realtimeSinceStartup;
                    task.PinTime      = args.PinTime;

                    //
                    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));
        }
示例#2
0
 LoadReturnArgs PreLoadAsset(PreLoadArgs args, AssetBundleTaskType type = AssetBundleTaskType.Sync | AssetBundleTaskType.PreLoadAsset)
 {
     return(PreLoadAsset(ref args, type));
 }