public override void OnInspectorGUI() { DrawDefaultInspector(); GridMesh myScript = (GridMesh)target; if (GUILayout.Button("Generate Grid")) { myScript.CreateGridMesh(); } }