public override void OnInspectorGUI() { DrawDefaultInspector(); NavGrid myScript = (NavGrid)target; if (GUILayout.Button("Build Grid")) { myScript.CreateGrid(); } }