示例#1
0
        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);
        }
示例#2
0
 //临时用一下dictionary, 后面自己设计合适的数据结构存储, 太费内存了
 public void AddToDB(string localPath, MappingInfo info)
 {
     _mappingInfos.Remove(localPath);
     _mappingInfos.Add(localPath, info);
 }
示例#3
0
 public bool TryGetMappingInfo(string localPath, out MappingInfo info)
 {
     localPath = localPath ?? string.Empty;
     return(_mappingInfos.TryGetValue(localPath, out info));
 }
示例#4
0
        private static bool _IsSmallEnough(MappingInfo info)
        {
            var isSmallEnough = info.selfSize < _lpfnBundleThresHold;

            return(isSmallEnough);
        }