mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-25 20:04:39 -05:00
50% audio implement
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user