public override void OnInspectorGUI() { DrawDefaultInspector(); PathGraph graph = target as PathGraph; if (GUILayout.Button("Create Node")) { PathNode node = graph.CreateRoot(); node.transform.position = graph.transform.position; Selection.activeGameObject = node.gameObject; } }