public override void OnInspectorGUI() { ReadCSV generator = (ReadCSV)target; if (GUILayout.Button("Generate text file")) { generator.GenerateTextFile(); } DrawDefaultInspector(); }