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; } }