diff --git a/Assets/Resources/Audio/Drink.ogg b/Assets/Resources/Audio/Drink.ogg new file mode 100644 index 0000000..508c509 Binary files /dev/null and b/Assets/Resources/Audio/Drink.ogg differ diff --git a/Assets/Resources/Audio/Drink.ogg.meta b/Assets/Resources/Audio/Drink.ogg.meta new file mode 100644 index 0000000..8efdd6f --- /dev/null +++ b/Assets/Resources/Audio/Drink.ogg.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 25942ecb34ea3764fad9cf75dc8a4f70 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/EventControls.cs b/Assets/Scripts/EventControls.cs index 43679a9..b9f8b89 100644 --- a/Assets/Scripts/EventControls.cs +++ b/Assets/Scripts/EventControls.cs @@ -174,12 +174,14 @@ public class EventControls : MonoBehaviour isInBattle = false; eventCycleAccumalator = 0; currentEventControl = null; - + player.ThrowUserInTheAirHurt(); + SoundManagerScript.PlaySound("bug laugh"); return; } else if (FailedToClickCorrect(currentEventControl.keyCode)) { + SoundManagerScript.PlaySound("wrong"); tilemap.SetTile(currentEventControl.position, currentEventControl.failTile); eventTriggered = false; isInBattle = false; @@ -187,6 +189,7 @@ public class EventControls : MonoBehaviour currentEventControl = null; player.ThrowUserInTheAirHurt(); + SoundManagerScript.PlaySound("bug laugh"); return; } diff --git a/Assets/Scripts/Player.cs b/Assets/Scripts/Player.cs index 4e23889..116d592 100644 --- a/Assets/Scripts/Player.cs +++ b/Assets/Scripts/Player.cs @@ -85,6 +85,7 @@ public class Player : MonoBehaviour private void DrinkCoffee() { + SoundManagerScript.PlaySound("drink"); int result = currentStamina + GetStaminaValueChange(coffeValuePercent); currentStamina = result < startStamina ? result : startStamina; staminaBar.size = new Vector2(staminaBar.size.x * (currentStamina/startStamina), staminaBar.size.y); diff --git a/Assets/Scripts/SoundManagerScript.cs b/Assets/Scripts/SoundManagerScript.cs index cfcc822..8964c0f 100644 --- a/Assets/Scripts/SoundManagerScript.cs +++ b/Assets/Scripts/SoundManagerScript.cs @@ -5,7 +5,7 @@ using UnityEngine; public class SoundManagerScript : MonoBehaviour { - public static AudioClip jumpSound, screamSound, wrongButtonSound, bugLaughSound; + public static AudioClip jumpSound, screamSound, wrongButtonSound, bugLaughSound, drinkSound; static AudioSource audioSrc; // Start is called before the first frame update @@ -15,6 +15,7 @@ public class SoundManagerScript : MonoBehaviour screamSound = Resources.Load("Audio/GirlyScream"); wrongButtonSound = Resources.Load("Audio/WrongButton"); bugLaughSound = Resources.Load("Audio/BugLaugh"); + drinkSound = Resources.Load("Audio/Drink"); audioSrc = GetComponent(); } @@ -41,6 +42,9 @@ public class SoundManagerScript : MonoBehaviour case "bug laugh": audioSrc.PlayOneShot(bugLaughSound); break; + case "drink": + audioSrc.PlayOneShot(drinkSound); + break; } } }