Beispiel #1
0
    void Update()
    {
        float value        = Mathf.InverseLerp(dbMin, 0, Mathf.Max(analyzer.GetDB(), dbMin));
        float decayedValue = Mathf.InverseLerp(dbMin, 0, Mathf.Max(analyzer.GetDBDecayed(), dbMin));

        bar.UpdateBar(value, decayedValue);
    }
    Color GetCurrentColor(bool left = true)
    {
        float value        = Mathf.Max(0.6f, Mathf.InverseLerp(dbMin, 0, Mathf.Max(analyzer.GetDBDecayed(), dbMin)));
        Color chosenColor  = left ? waveformColorL : waveformColorR;
        Color currentColor = new Color(chosenColor.r, chosenColor.g, chosenColor.b,
                                       useDBInColorAlpha == true ? value : chosenColor.a);

        return(currentColor);
    }