public override void OnInspectorGUI() { PedestrianArea myTarget = (PedestrianArea)target; EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(serializedObject.FindProperty("bDebug"), new GUIContent("Debug?")); EditorGUILayout.PropertyField(serializedObject.FindProperty("Size"), new GUIContent("Size")); EditorGUILayout.PropertyField(serializedObject.FindProperty("PatchResolution"), new GUIContent("PatchResolution")); bool changed = EditorGUI.EndChangeCheck(); if (GUILayout.Button("Build!", GUILayout.Height(100))) { myTarget.BuildWalkableArea(); } if (changed) { serializedObject.ApplyModifiedProperties(); } }
public void Awake() { _instance = this; }