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);; }
public float KnobPercent() { return(BraceletUtility.Remap01Clamped(angle + acumulatedAngle, angleMin, angleMax)); }