Exemplo n.º 1
0
        public virtual KeyValuePair <int, int> GetMapping(int folderId, int fileId)
        {
            T asset = GetAsset(folderId, fileId);

            if (asset == null || !CharMapValues.ContainsKey(asset))
            {
                return(new KeyValuePair <int, int>(folderId, fileId));
            }
            return(CharMapValues[asset]);
        }
Exemplo n.º 2
0
        public virtual T Get(int folderId, int fileId)
        {
            T asset = GetAsset(folderId, fileId);

            if (asset == null)
            {
                return(asset);
            }

            if (CharMapValues.ContainsKey(asset))
            {
                KeyValuePair <int, int> mapping = CharMapValues[asset];
                return(Get(mapping.Key, mapping.Value));
            }

            return(SwappedAssets.ContainsKey(asset) ? SwappedAssets[asset] : asset);
        }
Exemplo n.º 3
0
        protected virtual void ApplyCharMap(SpriterCharacterMap charMap)
        {
            if (charMap == null)
            {
                CharMapValues.Clear();
                return;
            }

            for (int i = 0; i < charMap.Maps.Length; ++i)
            {
                SpriterMapInstruction map = charMap.Maps[i];
                T sprite = GetAsset(map.FolderId, map.FileId);
                if (sprite == null)
                {
                    continue;
                }

                CharMapValues[sprite] = new KeyValuePair <int, int>(map.TargetFolderId, map.TargetFileId);
            }
        }