123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class LoadManager : Singleton<LoadManager>
- {
- public Dictionary<string, DownLoadItem> downList = new Dictionary<string, DownLoadItem>();
- public void load(ModelItem model, Action<float> onProgress, Action<GameObject> callback)
- {
- string dName = getLoadName(model.url, model.Version);
- if (!downList.ContainsKey(dName))
- {
- GameObject obj = new GameObject(dName);
- DownLoadItem dli = obj.AddComponent<DownLoadItem>();
- dli.Init(model.url, model.uid);
- }
- downList[dName].onProgress += (float f) => {
- onProgress.Invoke(f);
- };
- downList[dName].callback += (bool b) => {
- if(b)
- {
- if (!downList[dName].isAction)
- {
-
- switch (model.modelType)
- {
- case ModelItem.ModelType.Image:
- break;
- case ModelItem.ModelType.Video:
- break;
- case ModelItem.ModelType.ABModel:
- break;
- }
- }
- }
- else
- {
-
- }
- };
- }
- public string getLoadName(string url, string version)
- {
- return url + "_" + version;
- }
- }
|