aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Assets/Resources/SoundEffects/BackgroundMusic.mp3bin0 -> 3126218 bytes
-rw-r--r--Assets/Resources/SoundEffects/BackgroundMusic.mp3.meta22
-rw-r--r--Assets/Resources/SoundEffects/RunningOnGrass.mp3bin0 -> 47064 bytes
-rw-r--r--Assets/Resources/SoundEffects/RunningOnGrass.mp3.meta22
-rw-r--r--Assets/Scenes/Jungle.unity207
-rw-r--r--Assets/Scripts/Actors/Actor.cs2
-rw-r--r--Assets/Scripts/Actors/Player.cs2
-rw-r--r--Assets/Scripts/AudioManager.cs44
-rw-r--r--Assets/Scripts/AudioManager.cs.meta (renamed from Assets/Scripts/SoundManager.cs.meta)2
-rw-r--r--Assets/Scripts/Items/Whip.cs4
-rw-r--r--Assets/Scripts/Projectile.cs3
-rw-r--r--Assets/Scripts/Sound.cs20
-rw-r--r--Assets/Scripts/Sound.cs.meta11
-rw-r--r--Assets/Scripts/SoundManager.cs18
14 files changed, 206 insertions, 151 deletions
diff --git a/Assets/Resources/SoundEffects/BackgroundMusic.mp3 b/Assets/Resources/SoundEffects/BackgroundMusic.mp3
new file mode 100644
index 0000000..7e38579
--- /dev/null
+++ b/Assets/Resources/SoundEffects/BackgroundMusic.mp3
Binary files differ
diff --git a/Assets/Resources/SoundEffects/BackgroundMusic.mp3.meta b/Assets/Resources/SoundEffects/BackgroundMusic.mp3.meta
new file mode 100644
index 0000000..db3a4e2
--- /dev/null
+++ b/Assets/Resources/SoundEffects/BackgroundMusic.mp3.meta
@@ -0,0 +1,22 @@
+fileFormatVersion: 2
+guid: d2a59924c7fb9004c855636a01875783
+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/Resources/SoundEffects/RunningOnGrass.mp3 b/Assets/Resources/SoundEffects/RunningOnGrass.mp3
new file mode 100644
index 0000000..0f725f5
--- /dev/null
+++ b/Assets/Resources/SoundEffects/RunningOnGrass.mp3
Binary files differ
diff --git a/Assets/Resources/SoundEffects/RunningOnGrass.mp3.meta b/Assets/Resources/SoundEffects/RunningOnGrass.mp3.meta
new file mode 100644
index 0000000..19eeaa7
--- /dev/null
+++ b/Assets/Resources/SoundEffects/RunningOnGrass.mp3.meta
@@ -0,0 +1,22 @@
+fileFormatVersion: 2
+guid: 6528dc0afee26344d8c5e8e048251645
+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/Scenes/Jungle.unity b/Assets/Scenes/Jungle.unity
index 0605e3b..cdc91a9 100644
--- a/Assets/Scenes/Jungle.unity
+++ b/Assets/Scenes/Jungle.unity
@@ -734,7 +734,7 @@ Transform:
- {fileID: 222393495}
- {fileID: 2035916050}
m_Father: {fileID: 0}
- m_RootOrder: 2
+ m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &102491431
PrefabInstance:
@@ -1384,7 +1384,7 @@ Transform:
- {fileID: 778023473}
- {fileID: 510680167}
m_Father: {fileID: 0}
- m_RootOrder: 1
+ m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &160673865
PrefabInstance:
@@ -3692,7 +3692,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
- m_RootOrder: 14
+ m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &507557904
BoxCollider2D:
@@ -3749,8 +3749,6 @@ GameObject:
- component: {fileID: 519420031}
- component: {fileID: 519420029}
- component: {fileID: 519420033}
- - component: {fileID: 519420034}
- - component: {fileID: 519420035}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
@@ -3842,114 +3840,6 @@ MonoBehaviour:
- {fileID: 5264188901624758220, guid: 1e6541a2de44a6f4e9ccc8bda54bbe60, type: 3}
- {fileID: 3374466305813530289, guid: 0262f96f42c6aeb4684f54ead0bc9bcd, type: 3}
- {fileID: 8896288112839863083, guid: 97a792faae28dc44395a47b01d479474, type: 3}
---- !u!114 &519420034
-MonoBehaviour:
- m_ObjectHideFlags: 0
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_GameObject: {fileID: 519420028}
- m_Enabled: 1
- m_EditorHideFlags: 0
- m_Script: {fileID: 11500000, guid: 8b7601b2105f8e449902982334da1552, type: 3}
- m_Name:
- m_EditorClassIdentifier:
---- !u!82 &519420035
-AudioSource:
- m_ObjectHideFlags: 0
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_GameObject: {fileID: 519420028}
- m_Enabled: 1
- serializedVersion: 4
- OutputAudioMixerGroup: {fileID: 0}
- m_audioClip: {fileID: 0}
- m_PlayOnAwake: 1
- m_Volume: 1
- m_Pitch: 1
- Loop: 0
- Mute: 0
- Spatialize: 0
- SpatializePostEffects: 0
- Priority: 128
- DopplerLevel: 1
- MinDistance: 1
- MaxDistance: 500
- Pan2D: 0
- rolloffMode: 0
- BypassEffects: 0
- BypassListenerEffects: 0
- BypassReverbZones: 0
- rolloffCustomCurve:
- serializedVersion: 2
- m_Curve:
- - serializedVersion: 3
- time: 0
- value: 1
- inSlope: 0
- outSlope: 0
- tangentMode: 0
- weightedMode: 0
- inWeight: 0.33333334
- outWeight: 0.33333334
- - serializedVersion: 3
- time: 1
- value: 0
- inSlope: 0
- outSlope: 0
- tangentMode: 0
- weightedMode: 0
- inWeight: 0.33333334
- outWeight: 0.33333334
- m_PreInfinity: 2
- m_PostInfinity: 2
- m_RotationOrder: 4
- panLevelCustomCurve:
- serializedVersion: 2
- m_Curve:
- - serializedVersion: 3
- time: 0
- value: 0
- inSlope: 0
- outSlope: 0
- tangentMode: 0
- weightedMode: 0
- inWeight: 0.33333334
- outWeight: 0.33333334
- m_PreInfinity: 2
- m_PostInfinity: 2
- m_RotationOrder: 4
- spreadCustomCurve:
- serializedVersion: 2
- m_Curve:
- - serializedVersion: 3
- time: 0
- value: 0
- inSlope: 0
- outSlope: 0
- tangentMode: 0
- weightedMode: 0
- inWeight: 0.33333334
- outWeight: 0.33333334
- m_PreInfinity: 2
- m_PostInfinity: 2
- m_RotationOrder: 4
- reverbZoneMixCustomCurve:
- serializedVersion: 2
- m_Curve:
- - serializedVersion: 3
- time: 0
- value: 1
- inSlope: 0
- outSlope: 0
- tangentMode: 0
- weightedMode: 0
- inWeight: 0.33333334
- outWeight: 0.33333334
- m_PreInfinity: 2
- m_PostInfinity: 2
- m_RotationOrder: 4
--- !u!1 &522725465
GameObject:
m_ObjectHideFlags: 0
@@ -10452,7 +10342,7 @@ Transform:
- {fileID: 1538246388}
- {fileID: 1316225624}
m_Father: {fileID: 0}
- m_RootOrder: 3
+ m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &579896363
PrefabInstance:
@@ -10784,7 +10674,7 @@ RectTransform:
m_Children:
- {fileID: 75588535}
m_Father: {fileID: 0}
- m_RootOrder: 7
+ m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@@ -12397,6 +12287,75 @@ Grid:
m_CellGap: {x: 0, y: 0, z: 0}
m_CellLayout: 0
m_CellSwizzle: 0
+--- !u!1 &970237751
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 970237753}
+ - component: {fileID: 970237752}
+ m_Layer: 0
+ m_Name: AudioManager
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &970237752
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 970237751}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 19069c1158b5efd4492ea38fcb2aa53c, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ sounds:
+ - name: Gunshot
+ clip: {fileID: 8300000, guid: 791560ab56116084ebc209f37a62c59a, type: 3}
+ volume: 0.5
+ pitch: 1
+ loop: 0
+ source: {fileID: 0}
+ - name: WhipSwoosh
+ clip: {fileID: 8300000, guid: dc54d70b8657da04697bfab2772557ee, type: 3}
+ volume: 0.35
+ pitch: 0.85
+ loop: 0
+ source: {fileID: 0}
+ - name: RunningOnGrass
+ clip: {fileID: 8300000, guid: 6528dc0afee26344d8c5e8e048251645, type: 3}
+ volume: 1
+ pitch: 1
+ loop: 0
+ source: {fileID: 0}
+ - name: BackgroundMusic
+ clip: {fileID: 8300000, guid: d2a59924c7fb9004c855636a01875783, type: 3}
+ volume: 0.3
+ pitch: 1
+ loop: 1
+ source: {fileID: 0}
+--- !u!4 &970237753
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 970237751}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: -64.514595, y: -9.554787, z: -0.2852743}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 1
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &978844065 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 242561286231558221, guid: dfcf644fe2158f64c8540e6e54c9a5e4, type: 3}
@@ -13109,7 +13068,7 @@ RectTransform:
m_Children:
- {fileID: 1261295310}
m_Father: {fileID: 0}
- m_RootOrder: 13
+ m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@@ -13317,7 +13276,7 @@ Transform:
m_Children:
- {fileID: 819884911}
m_Father: {fileID: 0}
- m_RootOrder: 10
+ m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!95 &1238560273
Animator:
@@ -14766,7 +14725,7 @@ Transform:
- {fileID: 987504672}
- {fileID: 413676160}
m_Father: {fileID: 0}
- m_RootOrder: 5
+ m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1590045359
PrefabInstance:
@@ -15548,7 +15507,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
- m_RootOrder: 8
+ m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1670021806
MonoBehaviour:
@@ -326396,7 +326355,7 @@ Transform:
m_Children:
- {fileID: 2602158014812719780}
m_Father: {fileID: 0}
- m_RootOrder: 12
+ m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &199732720268733818
Transform:
@@ -326412,7 +326371,7 @@ Transform:
m_Children:
- {fileID: 2602158012877245240}
m_Father: {fileID: 0}
- m_RootOrder: 9
+ m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &242561286067450348
PrefabInstance:
@@ -326510,7 +326469,7 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 3218036852510780957, guid: 5634fecaf16a6234cbecd102e2675311, type: 3}
propertyPath: m_RootOrder
- value: 4
+ value: 5
objectReference: {fileID: 0}
- target: {fileID: 3218036852510780957, guid: 5634fecaf16a6234cbecd102e2675311, type: 3}
propertyPath: m_LocalPosition.x
@@ -326719,7 +326678,7 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 4788021209095683717, guid: f7f57f82eafa6be46b71b71e9117b9bf, type: 3}
propertyPath: m_RootOrder
- value: 6
+ value: 7
objectReference: {fileID: 0}
- target: {fileID: 4788021209095683717, guid: f7f57f82eafa6be46b71b71e9117b9bf, type: 3}
propertyPath: m_LocalPosition.x
@@ -327339,7 +327298,7 @@ Transform:
m_Children:
- {fileID: 8919320861079350896}
m_Father: {fileID: 0}
- m_RootOrder: 11
+ m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!212 &8919320862840140560
SpriteRenderer:
diff --git a/Assets/Scripts/Actors/Actor.cs b/Assets/Scripts/Actors/Actor.cs
index 96c67c2..e7f1a83 100644
--- a/Assets/Scripts/Actors/Actor.cs
+++ b/Assets/Scripts/Actors/Actor.cs
@@ -1,6 +1,4 @@
-using System;
using System.Collections;
-using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using MontanaJohns.Core;
diff --git a/Assets/Scripts/Actors/Player.cs b/Assets/Scripts/Actors/Player.cs
index 6201cad..0483be5 100644
--- a/Assets/Scripts/Actors/Player.cs
+++ b/Assets/Scripts/Actors/Player.cs
@@ -78,7 +78,7 @@ namespace MontanaJohns.Actors
protected void Fire()
{
Instantiate(projectilePrefab, firePoint.position, firePoint.rotation);
- SoundManager.PlaySound("Gunshot");
+ FindObjectOfType<AudioManager>().Play("Gunshot");
}
}
} \ No newline at end of file
diff --git a/Assets/Scripts/AudioManager.cs b/Assets/Scripts/AudioManager.cs
new file mode 100644
index 0000000..1809375
--- /dev/null
+++ b/Assets/Scripts/AudioManager.cs
@@ -0,0 +1,44 @@
+using System;
+using UnityEngine;
+using UnityEngine.Audio;
+
+public class AudioManager : MonoBehaviour
+{
+ public Sound[] sounds;
+
+ public static AudioManager instance;
+
+ private void Awake()
+ {
+ if (instance == null) instance = this;
+ else {
+ Destroy(gameObject);
+ return;
+ }
+
+ DontDestroyOnLoad(gameObject);
+
+ foreach (Sound s in sounds) {
+ s.source = gameObject.AddComponent<AudioSource>();
+ s.source.clip = s.clip;
+ s.source.volume = s.volume;
+ s.source.pitch = s.pitch;
+ s.source.loop = s.loop;
+ }
+ }
+
+ private void Start()
+ {
+ Play("BackgroundMusic");
+ }
+
+ public void Play(string name)
+ {
+ Sound s = Array.Find(sounds, sound => sound.name == name);
+ if (s == null) {
+ Debug.LogWarning("Sound Error: " + name + " could not be played");
+ return;
+ }
+ s.source.Play();
+ }
+}
diff --git a/Assets/Scripts/SoundManager.cs.meta b/Assets/Scripts/AudioManager.cs.meta
index c06b24e..c012381 100644
--- a/Assets/Scripts/SoundManager.cs.meta
+++ b/Assets/Scripts/AudioManager.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 8b7601b2105f8e449902982334da1552
+guid: 19069c1158b5efd4492ea38fcb2aa53c
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Assets/Scripts/Items/Whip.cs b/Assets/Scripts/Items/Whip.cs
index 17061f8..b482f8d 100644
--- a/Assets/Scripts/Items/Whip.cs
+++ b/Assets/Scripts/Items/Whip.cs
@@ -42,7 +42,7 @@ namespace MontanaJohns.Items
if (LayerMask.LayerToName(collisionGameObject.layer) == "Grapple")
{
currentHook = Instantiate(hook, collisionGameObject.transform.position, Quaternion.identity);
- SoundManager.PlaySound("WhipSwoosh");
+ FindObjectOfType<AudioManager>().Play("WhipSwoosh");
return clickLocation;
}
else
@@ -64,7 +64,7 @@ namespace MontanaJohns.Items
{
currentHook = Instantiate(hookNoSwing, collisionGameObject.transform.position, Quaternion.identity);
collisionGameObject.GetComponent<Actor>().TakeDamage(player.GetComponent<Player>().stats.damage);
- SoundManager.PlaySound("WhipSwoosh");
+ FindObjectOfType<AudioManager>().Play("WhipSwoosh");
yield return new WaitForSeconds(0.1f);
Destroy(currentHook);
ropeExists = false;
diff --git a/Assets/Scripts/Projectile.cs b/Assets/Scripts/Projectile.cs
index b07958b..1573d2c 100644
--- a/Assets/Scripts/Projectile.cs
+++ b/Assets/Scripts/Projectile.cs
@@ -1,7 +1,4 @@
-using System.Collections;
-using System.Collections.Generic;
using UnityEngine;
-using MontanaJohns.Actors;
public class Projectile : MonoBehaviour
{
diff --git a/Assets/Scripts/Sound.cs b/Assets/Scripts/Sound.cs
new file mode 100644
index 0000000..cfe26a4
--- /dev/null
+++ b/Assets/Scripts/Sound.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using UnityEngine.Audio;
+
+[System.Serializable]
+public class Sound
+{
+ public string name;
+ public AudioClip clip;
+
+ [Range(0f, 1f)]
+ public float volume;
+
+ [Range(.1f, 3f)]
+ public float pitch;
+
+ public bool loop;
+
+ [HideInInspector]
+ public AudioSource source;
+}
diff --git a/Assets/Scripts/Sound.cs.meta b/Assets/Scripts/Sound.cs.meta
new file mode 100644
index 0000000..37b81f6
--- /dev/null
+++ b/Assets/Scripts/Sound.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d61e3f443c2315b45a4a8326c6491504
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/SoundManager.cs b/Assets/Scripts/SoundManager.cs
deleted file mode 100644
index 128f41c..0000000
--- a/Assets/Scripts/SoundManager.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class SoundManager : MonoBehaviour
-{
- static AudioSource audioSrc;
-
- private void Start()
- {
- audioSrc = GetComponent<AudioSource>();
- }
-
- public static void PlaySound(string soundeffect)
- {
- audioSrc.PlayOneShot(Resources.Load<AudioClip>($"SoundEffects/{soundeffect}"));
- }
-}