以下の内容はhttps://baba-s.hatenablog.com/entry/2023/10/04/145705より取得しました。


【Unity】Tilemap.SetTiles の使用例

ソースコード

using System.Linq;
using UnityEngine;
using UnityEngine.Tilemaps;

internal sealed class Example : MonoBehaviour
{
    [SerializeField] private Tilemap m_tilemap;
    [SerializeField] private Tile    m_tile;

    private void Awake()
    {
        var tileChangeDataArray = new[] { Vector3Int.left, Vector3Int.zero, Vector3Int.right, }
                .Select( x => new TileChangeData( x, m_tile, Color.white, Matrix4x4.identity ) )
                .ToArray()
            ;

        m_tilemap.SetTiles
        (
            tileChangeDataArray: tileChangeDataArray,
            ignoreLockFlags: false
        );
    }
}



以上の内容はhttps://baba-s.hatenablog.com/entry/2023/10/04/145705より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14