Ejemplo n.º 1
0
    // 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);
    }
Ejemplo n.º 2
0
    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--;
    }
Ejemplo n.º 3
0
    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++;

        // frequency
        GUILayout.BeginHorizontal();
        float frequency    = _dsp.GetFloatParameter(Hv_waves_AudioLib.Parameter.Frequency);
        float newFrequency = EditorGUILayout.Slider("frequency", frequency, 50.0f, 4000.0f);

        if (frequency != newFrequency)
        {
            _dsp.SetFloatParameter(Hv_waves_AudioLib.Parameter.Frequency, newFrequency);
        }
        GUILayout.EndHorizontal();

        // gain
        GUILayout.BeginHorizontal();
        float gain    = _dsp.GetFloatParameter(Hv_waves_AudioLib.Parameter.Gain);
        float newGain = EditorGUILayout.Slider("gain", gain, 0.0f, 1.0f);

        if (gain != newGain)
        {
            _dsp.SetFloatParameter(Hv_waves_AudioLib.Parameter.Gain, newGain);
        }
        GUILayout.EndHorizontal();

        EditorGUI.indentLevel--;



        GUILayout.EndVertical();
    }