public override void OnInspectorGUI() { bool isEnabled = _dsp.IsInstantiated(); if (!isEnabled) { EditorGUILayout.LabelField("Press Play!", EditorStyles.centeredGreyMiniLabel); } GUILayout.BeginVertical(); // PARAMETERS GUI.enabled = true; EditorGUILayout.Space(); EditorGUI.indentLevel++; // decayTime GUILayout.BeginHorizontal(); float decayTime = _dsp.GetFloatParameter(Hv_heavy_AudioLib.Parameter.Decaytime); float newDecaytime = EditorGUILayout.Slider("decayTime", decayTime, 0.0f, 20000.0f); if (decayTime != newDecaytime) { _dsp.SetFloatParameter(Hv_heavy_AudioLib.Parameter.Decaytime, newDecaytime); } GUILayout.EndHorizontal(); // metro GUILayout.BeginHorizontal(); float metro = _dsp.GetFloatParameter(Hv_heavy_AudioLib.Parameter.Metro); float newMetro = EditorGUILayout.Slider("metro", metro, 1.0f, 100000.0f); if (metro != newMetro) { _dsp.SetFloatParameter(Hv_heavy_AudioLib.Parameter.Metro, newMetro); } GUILayout.EndHorizontal(); // resonacne GUILayout.BeginHorizontal(); float resonacne = _dsp.GetFloatParameter(Hv_heavy_AudioLib.Parameter.Resonacne); float newResonacne = EditorGUILayout.Slider("resonacne", resonacne, 0.0f, 100.0f); if (resonacne != newResonacne) { _dsp.SetFloatParameter(Hv_heavy_AudioLib.Parameter.Resonacne, newResonacne); } GUILayout.EndHorizontal(); // soundBar GUILayout.BeginHorizontal(); float soundBar = _dsp.GetFloatParameter(Hv_heavy_AudioLib.Parameter.Soundbar); float newSoundbar = EditorGUILayout.Slider("soundBar", soundBar, 0.0f, 10.0f); if (soundBar != newSoundbar) { _dsp.SetFloatParameter(Hv_heavy_AudioLib.Parameter.Soundbar, newSoundbar); } GUILayout.EndHorizontal(); // tonOne GUILayout.BeginHorizontal(); float tonOne = _dsp.GetFloatParameter(Hv_heavy_AudioLib.Parameter.Tonone); float newTonone = EditorGUILayout.Slider("tonOne", tonOne, 1.0f, 200.0f); if (tonOne != newTonone) { _dsp.SetFloatParameter(Hv_heavy_AudioLib.Parameter.Tonone, newTonone); } GUILayout.EndHorizontal(); // tonTwo GUILayout.BeginHorizontal(); float tonTwo = _dsp.GetFloatParameter(Hv_heavy_AudioLib.Parameter.Tontwo); float newTontwo = EditorGUILayout.Slider("tonTwo", tonTwo, 1.0f, 200.0f); if (tonTwo != newTontwo) { _dsp.SetFloatParameter(Hv_heavy_AudioLib.Parameter.Tontwo, newTontwo); } GUILayout.EndHorizontal(); EditorGUI.indentLevel--; GUILayout.EndVertical(); }
public override void OnInspectorGUI() { bool isEnabled = _dsp.IsInstantiated(); if (!isEnabled) { EditorGUILayout.LabelField("Press Play!", EditorStyles.centeredGreyMiniLabel); } GUILayout.BeginVertical(); // EVENTS GUI.enabled = isEnabled; EditorGUILayout.Space(); // bass if (GUILayout.Button("bass")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Bass); } // checkpoint0 if (GUILayout.Button("checkpoint0")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Checkpoint0); } // checkpoint1 if (GUILayout.Button("checkpoint1")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Checkpoint1); } // checkpoint2 if (GUILayout.Button("checkpoint2")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Checkpoint2); } // checkpoint3 if (GUILayout.Button("checkpoint3")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Checkpoint3); } // drum1 if (GUILayout.Button("drum1")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Drum1); } // drum2 if (GUILayout.Button("drum2")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Drum2); } // engine if (GUILayout.Button("engine")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Engine); } // fill1 if (GUILayout.Button("fill1")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Fill1); } // fill2 if (GUILayout.Button("fill2")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Fill2); } // finishline if (GUILayout.Button("finishline")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Finishline); } // startendvol if (GUILayout.Button("startendvol")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Startendvol); } // startstopseq if (GUILayout.Button("startstopseq")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Startstopseq); } // wall if (GUILayout.Button("wall")) { _dsp.SendEvent(Hv_heavy_AudioLib.Event.Wall); } // PARAMETERS GUI.enabled = true; EditorGUILayout.Space(); EditorGUI.indentLevel++; // frequency GUILayout.BeginHorizontal(); float frequency = _dsp.GetFloatParameter(Hv_heavy_AudioLib.Parameter.Frequency); float newFrequency = EditorGUILayout.Slider("frequency", frequency, 0.0f, 1000.0f); if (frequency != newFrequency) { _dsp.SetFloatParameter(Hv_heavy_AudioLib.Parameter.Frequency, newFrequency); } GUILayout.EndHorizontal(); EditorGUI.indentLevel--; GUILayout.EndVertical(); }