public MappingInfo GetMappingInfo(string localPath) { localPath = localPath ?? string.Empty; MappingInfo info; if (!_mappingDB.TryGetMappingInfo(localPath, out info) && os.isEditor) { var localPathWithDigest = localPath; var fullPath = PathTools.GetExportPath(localPath); info = new MappingInfo() { localPath = localPath , localPathWithDigest = localPathWithDigest , selfSize = os.path.getsize(fullPath) , totalSize = 0 , loadType = LoadType.Disk }; _mappingDB.AddToDB(localPath, info); } return(info); }
//临时用一下dictionary, 后面自己设计合适的数据结构存储, 太费内存了 public void AddToDB(string localPath, MappingInfo info) { _mappingInfos.Remove(localPath); _mappingInfos.Add(localPath, info); }
public bool TryGetMappingInfo(string localPath, out MappingInfo info) { localPath = localPath ?? string.Empty; return(_mappingInfos.TryGetValue(localPath, out info)); }
private static bool _IsSmallEnough(MappingInfo info) { var isSmallEnough = info.selfSize < _lpfnBundleThresHold; return(isSmallEnough); }