ドキュメント

Unity Engine

Unity Engine

GetTileEntityId(Vector3Int)

Gets the EntityId of the Tile at the given xyz coordinates of a cell in the Tilemap.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

public virtual EntityId GetTileEntityId(Vector3Int position)

Parameters

position

The position of the Tile on the Tilemap.

Returns

Type

Description

EntityIdEntityId of the TileBase placed at the cell.

Examples

using UnityEngine;using UnityEngine.Tilemaps;public static class TilemapExample{ public static void GetTileEntityIdExample(ITilemap tilemap, Vector3Int position, Tile tile) { tilemap.GetComponent<Tilemap>().SetTile(position, tile); var tileId = tilemap.GetTileEntityId(position); Debug.Log($"The ids for the Tile placed are equal ({(tileId == tile.GetEntityId()).ToString()})"); }}