ドキュメント

Unity Engine

Unity Engine

SwapTile(TileBase, TileBase)

Swaps all existing Tile s of changeTile to newTile and refreshes all the swapped Tile s.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

public void SwapTile(TileBase changeTile, TileBase newTile)

Parameters

changeTile

Tile to swap.

newTile

Tile to swap to.

Remarks

Refer to Scriptable Tiles and Tilemap for more information.

Examples

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