public void onInit() { for (int i = 0; i < depends.Count; i++) { AssetMgr.addRef(depends[i], 1); } AssetMgr.addRef(url, 1); }
private void insObj(Action <GameObject> callBack) { GameObject go = GameObject.Instantiate(this.obj) as GameObject; GameObject.DontDestroyOnLoad(go); PoolObj po = go.AddComponent <PoolObj>(); po.resName = resName; for (int i = 0; i < deps.Count; i++) { AssetMgr.addRef(deps[i]); } AssetMgr.addRef(resName); callBack.Invoke(go); }
void doCheck(string name) { //1 ab池子是否已经有了 bool hasAB = AssetMgr.has(name); if (hasAB) { AssetMgr.addRef(name); taskFinish(""); } else { //如果加载任务里面有此任务 则加回调 if (LoadMgr.hasTask(name)) { LoadMgr.addHandler(name, taskFinish); } else { string resPath = Path.Combine(Define.abPre, name).ToLower(); LoadMgr.doLoad(name, resPath, taskFinish); } } }
//添加引用 public static void addRef(string resName) { AssetMgr.addRef(resName); }