void OnEnable() { creator = (MapCreator)target; if (creator.grid == null) { creator.CreateGrid(); } Debug.Log(creator.transform.name); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUI.BeginChangeCheck(); if (GUILayout.Button("Create new")) { Undo.RecordObject(creator, "Create new"); creator.CreateGrid(); } if (GUILayout.Button("Create Mesh")) { Undo.RecordObject(creator, "Create new Mesh"); creator.CreateMesh(); } }