Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions Assets/Scripts/Audio/PlayerSFX.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Collections.Generic;
using UnityEngine;

public class PlayerSFX : MonoBehaviour
Expand Down Expand Up @@ -98,15 +97,25 @@ private void Dodge()
{
int i = Random.Range(0, grassRoll.Length);
int j = Random.Range(0, armourJingle.Length);
audioPlayer.PlayOnce(armourJingle[j], audioManager.SFXVol/2);
audioPlayer.PlayOnce(rollArray[i], audioManager.SFXVol);
//Debug.Log(i);

if (armourJingle.Length > i && armourJingle[i] != null)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just going for the simple solution here while we aim for stability, but we should really refactor this audio system later if we get the chance

{
audioPlayer.PlayOnce(armourJingle[j], audioManager.SFXVol/2);
}

if (rollArray.Length > j && rollArray[i] != null)
{
audioPlayer.PlayOnce(rollArray[i], audioManager.SFXVol);
}
}
private void Parry()
{
int i = Random.Range(0, parry.Length);
audioPlayer.PlayOnce(parry[i], audioManager.SFXVol);
//Debug.Log(i);

if (parry.Length > i && parry[i] != null)
{
audioPlayer.PlayOnce(parry[i], audioManager.SFXVol);
}
}


Expand All @@ -124,6 +133,10 @@ public void Unsheath()
public void AllUnsheath()
{
int i = Random.Range(0, allUnsheath.Length);
audioPlayer.PlayOnce(allUnsheath[i], audioManager.SFXVol);

if (allUnsheath.Length > i && allUnsheath[i] != null)
{
audioPlayer.PlayOnce(allUnsheath[i], audioManager.SFXVol);
}
}
}