50% audio implement

This commit is contained in:
Vladdie
2022-05-01 06:46:35 -05:00
parent 3a2896a2a7
commit 36d9c98a2b
22 changed files with 1550 additions and 146 deletions

View File

@@ -622,6 +622,7 @@ public class AerialStateManager : NetworkBehaviour
{
//Debug.Log("Found Hook");
hookPoint = hookPoints[hookPointIndex]; //The point we are grappling from
grappleSound.Play();
return true;
}
}

View File

@@ -83,6 +83,13 @@ public class MoveStateManager : NetworkBehaviour
public float distToGround; // distance to ground
////
//audio set
public AudioSource slideAudio;
public AudioSource skateAudio;
public AudioSource dirtStep1, dirtStep2, dirtStep3, dirtStep4, dirtStep5, dirtStep6;
public AudioSource rainStep1, rainStep2, rainStep3, rainStep4, rainStep5, rainStep6;
public AudioSource snowStep1, snowStep2, snowStep3, snowStep4, snowStep5, snowStep6;
bool hasPlayed;
void Awake(){
@@ -336,8 +343,22 @@ public class MoveStateManager : NetworkBehaviour
Vector3 moveXZ = new Vector3(vel.x, 0, vel.z);
driftVel = Vector3.Lerp(driftVel, moveXZ, pStats.CurTraction * Time.deltaTime);
//True false set here to stop the audio from playing each time = to FPS
if (hasPlayed == false)
{
hasPlayed = true;
slideAudio.Play();
}
else
{
hasPlayed = false;
}
//Actually move he player
moveController.Move(driftVel);
}
//Camera and player rotation

View File

@@ -43,6 +43,9 @@ public class OffenseStateManager : NetworkBehaviour
private AnimationManager animationManager;
////
/// audio
public AudioSource kickSound;
//// Variables Section
private GameObject[] players;
@@ -111,6 +114,9 @@ public class OffenseStateManager : NetworkBehaviour
currentState = state;
animationManager.updateCurrentPriority();
currentState.EnterState(this, previousState);
}
//Collision checker for the leg