Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetEditorPreviewTileEntityId(Vector3Int)

Gets the EntityId of the editor preview Tile at the given xyz coordinates of a cell in the Tilemap.
Read time 1 minuteLast updated 10 days ago

Definition

public EntityId GetEditorPreviewTileEntityId(Vector3Int position)

Parameters

position

The position of the editor preview Tile on the Tilemap.

Returns

Type

Description

EntityIdThe EntityId of the editor preview Tile placed at the cell.

Examples

using UnityEngine;using UnityEngine.Tilemaps;public static class TilemapExample{ public static void GetEditorPreviewTileEntityIdExample(Tilemap tilemap, Vector3Int position, Tile tile) { tilemap.SetEditorPreviewTile(position, tile); var tileId = tilemap.GetEditorPreviewTileEntityId(position); Debug.Log($"The ids for the Tile placed are equal ({(tileId == tile.GetEntityId()).ToString()})"); }}