/// <summary> /// 给ObjectsManager提供的接口,加载resGo /// </summary> public void AsyncLoadResource(string path, ResourceGameObject resGo, AsyncLoadResGoDealFinish resGoDealFinish) { uint pathCrc = Crc32.GetCRC32(path); AssetBundleDataItem dataItem = GetCacheABDataItem(pathCrc); if (dataItem != null) { resGo.ABDataItem = dataItem; if (resGoDealFinish != null) { resGoDealFinish(path, resGo, resGo.Param1, resGo.Param2, resGo.Param3); } return; } AsyncLoadDataItem asyncDataItem = null; if (!m_asyncLoadingItemDic.TryGetValue(pathCrc, out asyncDataItem) && asyncDataItem == null) { asyncDataItem = m_asyncDataItemPool.Create(true); asyncDataItem.Path = path; asyncDataItem.Crc = pathCrc; asyncDataItem.Priority = resGo.Priority; m_asyncLoadItemListArray[(int)resGo.Priority].Add(asyncDataItem); m_asyncLoadingItemDic.Add(pathCrc, asyncDataItem); } AsyncLoadCallBack callBack = m_asyncCallBackPool.Create(true); callBack.ResGoDealFinish = resGoDealFinish; callBack.resGo = resGo; asyncDataItem.CallBackList.Add(callBack); }
public void Reset() { ResGoDealFinish = null; resGo = null; DealFinish = null; Param1 = null; Param2 = null; Param3 = null; }