// Use this for initialization void Start() { shipControl = GetComponent <ShipFixedPathing>(); script = GetComponent <Hv_wind_AudioLib>(); volume = script.GetFloatParameter(Hv_wind_AudioLib.Parameter.Volume); script.SetFloatParameter(Hv_wind_AudioLib.Parameter.Volume, 0.9f); windSpeed = script.GetFloatParameter(Hv_wind_AudioLib.Parameter.Windspeed); waves = GetComponent <Hv_waves_AudioLib>(); waveVolume = waves.GetFloatParameter(Hv_waves_AudioLib.Parameter.Volume); waveSpeed = waves.GetFloatParameter(Hv_waves_AudioLib.Parameter.Volume); waves.SendEvent(Hv_waves_AudioLib.Event.Turnon); }
public override void OnInspectorGUI() { bool isEnabled = _dsp.IsInstantiated(); if (!isEnabled) { EditorGUILayout.LabelField("Press Play!", EditorStyles.centeredGreyMiniLabel); } // events GUI.enabled = isEnabled; EditorGUILayout.Space(); // turnon if (GUILayout.Button("turnon")) { _dsp.SendEvent(Hv_waves_AudioLib.Event.Turnon); } GUILayout.EndVertical(); // parameters GUI.enabled = true; GUILayout.BeginVertical(); EditorGUILayout.Space(); EditorGUI.indentLevel++; // volume GUILayout.BeginHorizontal(); float volume = _dsp.GetFloatParameter(Hv_waves_AudioLib.Parameter.Volume); float newVolume = EditorGUILayout.Slider("volume", volume, 10.0f, 100.0f); if (volume != newVolume) { _dsp.SetFloatParameter(Hv_waves_AudioLib.Parameter.Volume, newVolume); } GUILayout.EndHorizontal(); // wavespeed GUILayout.BeginHorizontal(); float wavespeed = _dsp.GetFloatParameter(Hv_waves_AudioLib.Parameter.Wavespeed); float newWavespeed = EditorGUILayout.Slider("wavespeed", wavespeed, 10.0f, 100.0f); if (wavespeed != newWavespeed) { _dsp.SetFloatParameter(Hv_waves_AudioLib.Parameter.Wavespeed, newWavespeed); } GUILayout.EndHorizontal(); EditorGUI.indentLevel--; }