Skip to content

Instantly share code, notes, and snippets.

@wallstop
Created June 13, 2025 16:10
Show Gist options
  • Save wallstop/5c6db816e0cb9659e0348bff844f69b4 to your computer and use it in GitHub Desktop.
Save wallstop/5c6db816e0cb9659e0348bff844f69b4 to your computer and use it in GitHub Desktop.
Hex - KTile
namespace World.Tiles
{
using Core.Extension;
using Metadata;
using UnityEngine;
using UnityEngine.Tilemaps;
public enum TileType
{
Nothing = 0,
Grass = 1,
Gravel = 2,
Stone = 3,
BridgeConnectFromNorth = 4,
BridgeConnectToNorth = 5,
BridgeConnectFromNorthEast = 6,
BridgeConnectToNorthEast = 7,
BridgeConnectFromSouthEast = 8,
BridgeConnectToSouthEast = 9,
BridgeConnectFromSouth = 10,
BridgeConnectToSouth = 11,
BridgeConnectFromSouthWest = 12,
BridgeConnectToSouthWest = 13,
BridgeConnectFromNorthWest = 14,
BridgeConnectToNorthWest = 15,
BridgeConnectFromEast = 16,
BridgeConnectToEast = 17,
BridgeConnectFromWest = 18,
BridgeConnectToWest = 19,
ArenaCenter = 20,
}
[CreateAssetMenu(fileName = "NewTile", menuName = "Tiles/KTile")]
public sealed class KTile : Tile, ITilemapTile
{
public TilemapType TilemapType => tilemapType;
public TilemapType tilemapType;
public TileType tileType;
public Tag tags;
public override string ToString()
{
return new
{
tilemapType,
tileType,
tags = tags.Split(),
sprite.name,
}.ToJson();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment