Exemplo n.º 1
0
    void UpdateAudio()
    {
        Vector3 direction = (listener.transform.position - audioSource.transform.position).normalized;

        audioAngle = Mathf.Abs(Vector3.Angle(audioSource.transform.forward, direction) - 90);

        float tAngle = Mathf.Clamp01(audioAngle / 90.0f);
        float tSpeed = BraceletUtility.Remap01Clamped(bladeSpeed, minSpeed, maxSpeed);

        audioSource.volume = angleVolumeCurve.Evaluate(tAngle) * speedVolumeCurve.Evaluate(tSpeed);;
        audioSource.pitch  = speedPitchCurve.Evaluate(tSpeed);;
    }
Exemplo n.º 2
0
 public float KnobPercent()
 {
     return(BraceletUtility.Remap01Clamped(angle + acumulatedAngle, angleMin, angleMax));
 }