概要
EditorWindow.GetWindow
の引数desiredDockNextTo
にtypeof
でタイプを指定すると、そのタイプの隣に
ウィンドウがくるサンプル。
コード
using UnityEditor; using UnityEngine; using UnityEngine.UIElements; public class ExampleWindow : EditorWindow { [MenuItem("Window/ExampleWindow")] static void Init() { // SceneViewの隣にExampleWindowがドックする。 GetWindow<ExampleWindow>(desiredDockNextTo: typeof(SceneView)); } void OnEnable() { var button1 = new Button(() => Debug.Log("button1")) { name = "button1", text = "button1" }; rootVisualElement.Add(button1); } }