void OnGUI() { EditorGUIUtility.fieldWidth = 150f; EditorGUIUtility.labelWidth = 80f; _soundBank = ( GATSoundBank )EditorGUILayout.ObjectField("Sound Bank: ", _soundBank, typeof(GATSoundBank), false, GUILayout.ExpandWidth(false)); if (_soundBank == false) { EditorGUILayout.HelpBox(__soundBankHelp, MessageType.Info); GUI.enabled = false; } else { _bankType = ( BankType )EditorGUILayout.EnumPopup("Bank Type: ", _bankType, GUILayout.ExpandWidth(false)); EditorGUILayout.HelpBox(__bankTypesHelp[( int )_bankType], MessageType.Info); } GUI.color = Color.green; if (GUILayout.Button("Create", GUILayout.Width(70f))) { GATEditorUtilities.CheckManager(); GATSampleBank bank = null; switch (_bankType) { case BankType.Simple: bank = GATEditorUtilities.NewChildGO <GATSampleBank>("Sample Bank"); break; case BankType.Active: bank = GATEditorUtilities.NewChildGO <GATActiveSampleBank>("Sample Bank"); break; } bank.EditorUpdateSoundBank(_soundBank); this.Close(); } }
void OnEnable() { _sampleBank = target as GATSampleBank; }