기술 자료

Unity Engine

Unity Engine

SwapTile(TileBase, TileBase)

Swaps all existing Tile s of changeTile to newTile and refreshes all the swapped Tile s.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

public void SwapTile(TileBase changeTile, TileBase newTile)

Parameters

changeTile

Tile to swap.

newTile

Tile to swap to.

Remarks

// Change all occurences of tileA into tileBusing UnityEngine;using UnityEngine.Tilemaps;public class ExampleClass : MonoBehaviour{ public TileBase tileA; public TileBase tileB; void Start() { Tilemap tilemap = GetComponent<Tilemap>(); tilemap.SwapTile(tileA, tileB); }}
Refer to Scriptable Tiles and Tilemap for more information.