概要
using UnityEditor;
using UnityEditor.Tilemaps;
using UnityEngine;
[InitializeOnLoad]
public static class Example
{
static Example()
{
GridPaintingState.scenePaintTargetChanged += OnChanged;
}
[MenuItem( "Tools/Log" )]
private static void Log()
{
Debug.Log( GridPaintingState.scenePaintTarget );
GridPaintingState.scenePaintTarget = Selection.activeGameObject;
}
private static void OnChanged( GameObject gameObject )
{
Debug.Log( gameObject.name );
}
}
- GridPaintingState.scenePaintTargetChanged
- Active Tilemap が変更された時に呼び出される
- GridPaintingState.scenePaintTarget
参考サイト様