public override void OnInspectorGUI() { base.OnInspectorGUI(); PlanetGenerator generator = (PlanetGenerator)target; if (generator.IsAuto) { generator.GeneratePlanetsInEditor(); } if (GUILayout.Button("Generate")) { generator.GeneratePlanetsInEditor(); } }