Пример #1
0
        public override void GetTileData(Vec3I gridPos, TM.ITilemap itilemap, ref TM.TileData tileData)
        {
            Vec2I pos     = GridToTile(gridPos);
            Vec2I subTile = GridToSubTile(gridPos);

            Map.BBTile tile = GetTile(pos);

            TileSprite sprite = HasSprite(tile, pos, subTile) ? GetSprite(tile, pos, subTile) : null;

            tileData = new TM.TileData
            {
                sprite       = sprite.sprite,
                color        = sprite.color,
                transform    = sprite.xform,
                gameObject   = null,
                flags        = TM.TileFlags.None,
                colliderType = ColliderType.None
            };

            // Unity so broken (requires tileData.color to be set also *shrug*)
            tilemap.SetColor(gridPos, sprite.color);
        }
Пример #2
0
 private TileSprite Virtualize(TileSprite sprite)
 => new TileSprite(sprite.sprite, sprite.color * new Color(.6f, .6f, 1, .5f));