ソースコード
using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "CONTEXT/Material/Hoge" )] private static void Hoge( MenuCommand command ) { var material = command.context as Material; // ... } }
実行結果
using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "CONTEXT/Material/Hoge" )] private static void Hoge( MenuCommand command ) { var material = command.context as Material; // ... } }