LoginSignup
2
2

More than 5 years have passed since last update.

エディタ拡張でメニューにショートカットを作成する

Last updated at Posted at 2017-02-06

サンプル

image

ツールバーに自分のプログラムを追加する

MyChildhoodDreamEditor
#region

using UnityEditor;
using UnityEngine;

#endregion

/// <summary>
/// エディタ拡張(ウィンドウを作成する)
/// </summary>
public class MyChildhoodDreamEditor : EditorWindow
{
    [MenuItem("ExpansionTool/hogehoge %t")]
    private static void Open()
    {
        EditorWindow.GetWindow<MyChildhoodDreamEditor>("ほげほげ");
    }

    private void OnGUI()
    {
        if (GUILayout.Button("実行")) {
            Debug.Log("hogehoge");
        }
    }
}

ツールバーのショートカット(tは変更可能)

記号 キー
%t Ctrl + t
&t Alt + t
#t Shift + t
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2