test commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit.Locomotion.Movement;
|
||||
|
||||
public class PlayerFootsteps : MonoBehaviour
|
||||
{
|
||||
public ContinuousMoveProvider ContinuousMoveProvider;
|
||||
public AudioSource AudioSource;
|
||||
public float MaxVolume = 0.75f;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (!Player.Instance) return;
|
||||
|
||||
var input = ContinuousMoveProvider.leftHandMoveInput.ReadValue(); // fuck you, the actual game does it like this too.
|
||||
if (Mathf.Abs(input.x) + Mathf.Abs(input.y) > 0.1f)
|
||||
AudioSource.volume = Mathf.Lerp(AudioSource.volume, MaxVolume, Time.deltaTime * 20f);
|
||||
else
|
||||
AudioSource.volume = Mathf.Lerp(AudioSource.volume, 0, Time.deltaTime * 20f);
|
||||
|
||||
AudioSource.pitch = (Player.Instance.running) ? 1.5f : 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user