SwapTile(TileBase, TileBase)
Swaps all existing Tile s of changeTile to newTile and refreshes all the swapped Tile s.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Tilemaps
- Assembly: UnityEngine.TilemapModule
public void SwapTile(TileBase changeTile, TileBase newTile)
Parameters
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); }}