protected override bool ApplyRevertGUIButtons() { EditorGUI.BeginDisabledGroup(!this.HasModified()); base.RevertButton(); bool result = base.ApplyButton("Apply Prefab"); EditorGUI.EndDisabledGroup(); bool upgradeMaterials = this.upgradeMaterials; GUIContent content = (!this.HasModified() && !upgradeMaterials) ? SpeedTreeImporterInspector.Styles.Regenerate : SpeedTreeImporterInspector.Styles.ApplyAndGenerate; if (GUILayout.Button(content, new GUILayoutOption[0])) { bool flag = this.HasModified(); if (flag) { this.Apply(); } if (upgradeMaterials) { SpeedTreeImporter[] importers = this.importers; for (int i = 0; i < importers.Length; i++) { SpeedTreeImporter speedTreeImporter = importers[i]; speedTreeImporter.SetMaterialVersionToCurrent(); } } this.GenerateMaterials(); if (flag || upgradeMaterials) { base.ApplyAndImport(); result = true; } } return(result); }