예제 #1
0
        public EAssetFileInfoKey CopyInfo()
        {
            EAssetFileInfoKey key = new EAssetFileInfoKey();

            key.Guid      = Guid;
            key.Size      = Size;
            key.AssetType = AssetType;
            return(key);
        }
예제 #2
0
        public override bool Equals(object key)
        {
            if (!(key is EAssetFileInfoKey))
            {
                return(false);
            }
            EAssetFileInfoKey other = key as EAssetFileInfoKey;

            if (other.Guid == Guid &&
                Size == other.Size &&
                other.AssetType == AssetType)
            {
                return(true);
            }
            return(false);
        }
예제 #3
0
        public static EAssetFileInfo FindAssetFile(long guid, long size, E_AssetType type)
        {
            if (_assetFileInfos == null)
            {
                _assetFileInfos = new Dictionary <EAssetFileInfoKey, EAssetFileInfo>();
            }

            EAssetFileInfo info;

            sKey.Guid      = guid;
            sKey.AssetType = type;
            sKey.Size      = size;
            if (!_assetFileInfos.TryGetValue(sKey, out info))
            {
                info = new EAssetFileInfo(guid);
                EAssetFileInfoKey newKey = sKey.CopyInfo();
                _assetFileInfos.Add(newKey, info);
            }
            return(info);
        }