public PDModule(int id, PDEditorModule editorModule, PDAudioItemManager itemManager, PDPlayer pdPlayer) : base(editorModule.Name, id, itemManager, pdPlayer) { this.Volume = editorModule.Volume; this.spatializer = new PDSpatializer(editorModule, pdPlayer); this.pdPlayer = pdPlayer; Initialize(); }
public override void OnInspectorGUI() { pdPlayer = (PDPlayer)target; editorHelper = pdPlayer.editorHelper; editorHelperProperty = serializedObject.FindProperty("editorHelper"); modulesProperty = editorHelperProperty.FindPropertyRelative("modules"); defaultModule = editorHelper.defaultModule; defaultModuleProperty = editorHelperProperty.FindPropertyRelative("defaultModule"); Begin(); ShowGeneralSettings(); Separator(); ShowDefaultSettings(); Separator(); ShowModules(); End(); }
void ShowModules() { if (LargeAddElementButton(modulesProperty, new GUIContent("Add New Module"))) { editorHelper.modules[editorHelper.modules.Count - 1] = new PDEditorModule("", defaultModule, pdPlayer); editorHelper.modules[editorHelper.modules.Count - 1].SetUniqueName("default", editorHelper.modules); } for (int i = 0; i < editorHelper.modules.Count; i++) { currentModule = editorHelper.modules[i]; currentModuleProperty = modulesProperty.GetArrayElementAtIndex(i); BeginBox(); if (DeleteElementFoldOutWithArrows(modulesProperty, i, new GUIContent(currentModule.Name, "Sets specific settings for a module."), GetStateColorStyle())) { break; } ShowModule(); EndBox(); } }