void 调用是否成功。
从脚本化瓦片中检索任何瓦片渲染数据。
using UnityEngine; using UnityEngine.Tilemaps;
// Tile that repeats two sprites in checkerboard pattern [CreateAssetMenu] public class CheckerboardTile : TileBase { public Sprite spriteA; public Sprite spriteB;
public override void GetTileData(Vector3Int position, ITilemap tilemap, ref TileData tileData) { bool evenCell = Mathf.Abs(position.y + position.x) % 2 > 0; tileData.sprite = evenCell ? spriteA : spriteB; } }