public override void OnInspectorGUI() { LevelCreator levelCreator = (LevelCreator)target; DrawDefaultInspector(); if (GUILayout.Button("Generate")) { levelCreator.GenerateLevel(); } }
public override void OnInspectorGUI() { LevelCreator creator = (LevelCreator)target; SerializedObject so = new SerializedObject(target); SerializedProperty stringsProperty = so.FindProperty("entrance"); SerializedProperty stringsProperty1 = so.FindProperty("target"); EditorGUILayout.PropertyField(stringsProperty, true); EditorGUILayout.PropertyField(stringsProperty1, true); so.ApplyModifiedProperties(); GUILayout.Space(10); if (GUILayout.Button("Create Level")) { creator.GenerateLevel(); } }