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


【Unity】Unity 2019.2 以降なら Tilemap の Tile Palette で選択されているパレットをスクリプトから取得・設定できる

概要

using UnityEditor;
using UnityEditor.Tilemaps;
using UnityEngine;

public static class Example
{
    [MenuItem( "Tools/Log" )]
    private static void Log()
    {
        // 選択中のパレットを取得する
        Debug.Log( GridPaintingState.palette );
        
        // 選択中のパレットを変更する
        var path    = "Assets/CustomPalette.prefab";
        var palette = AssetDatabase.LoadAssetAtPath<GameObject>( path );
        GridPaintingState.palette = palette;
    }
}
  • GridPaintingState.palette
    • 選択中のパレットを取得・設定できる

f:id:baba_s:20190929142750p:plain

参考サイト様




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

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