diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 3d0daba..cb7f149 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -1635,6 +1635,12 @@ MonoBehaviour: runningParticles: {fileID: 1608137079} mainObject: {fileID: 3244356567786994345} audioSource: {fileID: 1943902172017936589} + jumpClips: + - {fileID: 8300000, guid: 48262e53308f9ee44b7ea428e20433e8, type: 3} + - {fileID: 8300000, guid: fb8354238ee05b2428c8018b060f8b02, type: 3} + - {fileID: 8300000, guid: c17451694befdcd4c858556777f35b2d, type: 3} + - {fileID: 8300000, guid: da7577d64ed743a479eb66b7b25ef537, type: 3} + - {fileID: 8300000, guid: 494197b7e4667cf429bef31c31392309, type: 3} audioClips: - {fileID: 8300000, guid: 5e15f53ccc08c4e4496e13306a9e4743, type: 3} - {fileID: 8300000, guid: 049628ae43735224990d9bcea2f744ad, type: 3} diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 6585f23..153d760 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -33,6 +33,7 @@ public class PlayerController : MonoBehaviour public ParticleSystem runningParticles; public Transform mainObject; public AudioSource audioSource; + public List jumpClips = new List(); public List audioClips = new List(); // Start is called before the first frame update @@ -138,6 +139,10 @@ public class PlayerController : MonoBehaviour if (inAir) { // Debug.Log("Jump"); + if (audioSource != null && jumpClips.Count > 0) + { + audioSource.PlayOneShot(jumpClips[Random.Range(0, jumpClips.Count)]); + } rb.AddForce(transform.up * jumpSpeed * 100f * Time.deltaTime, ForceMode.Impulse); inAir = false; } diff --git a/Assets/Sounds/Jump.meta b/Assets/Sounds/Jump.meta new file mode 100644 index 0000000..e2623f0 --- /dev/null +++ b/Assets/Sounds/Jump.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dbb89856740468a45a281b520cce227e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sounds/Jump/Jump01.mp3 b/Assets/Sounds/Jump/Jump01.mp3 new file mode 100644 index 0000000..9cbbee0 Binary files /dev/null and b/Assets/Sounds/Jump/Jump01.mp3 differ diff --git a/Assets/Sounds/Jump/Jump01.mp3.meta b/Assets/Sounds/Jump/Jump01.mp3.meta new file mode 100644 index 0000000..6ab3389 --- /dev/null +++ b/Assets/Sounds/Jump/Jump01.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 48262e53308f9ee44b7ea428e20433e8 +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/Sounds/Jump/Jump02.mp3 b/Assets/Sounds/Jump/Jump02.mp3 new file mode 100644 index 0000000..7c2547d Binary files /dev/null and b/Assets/Sounds/Jump/Jump02.mp3 differ diff --git a/Assets/Sounds/Jump/Jump02.mp3.meta b/Assets/Sounds/Jump/Jump02.mp3.meta new file mode 100644 index 0000000..382bfe0 --- /dev/null +++ b/Assets/Sounds/Jump/Jump02.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: fb8354238ee05b2428c8018b060f8b02 +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/Sounds/Jump/Jump03.mp3 b/Assets/Sounds/Jump/Jump03.mp3 new file mode 100644 index 0000000..92e294d Binary files /dev/null and b/Assets/Sounds/Jump/Jump03.mp3 differ diff --git a/Assets/Sounds/Jump/Jump03.mp3.meta b/Assets/Sounds/Jump/Jump03.mp3.meta new file mode 100644 index 0000000..ae26aae --- /dev/null +++ b/Assets/Sounds/Jump/Jump03.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: c17451694befdcd4c858556777f35b2d +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/Sounds/Jump/Jump04.mp3 b/Assets/Sounds/Jump/Jump04.mp3 new file mode 100644 index 0000000..12c31a0 Binary files /dev/null and b/Assets/Sounds/Jump/Jump04.mp3 differ diff --git a/Assets/Sounds/Jump/Jump04.mp3.meta b/Assets/Sounds/Jump/Jump04.mp3.meta new file mode 100644 index 0000000..443bc49 --- /dev/null +++ b/Assets/Sounds/Jump/Jump04.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: da7577d64ed743a479eb66b7b25ef537 +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/Sounds/Jump/Jump05.mp3 b/Assets/Sounds/Jump/Jump05.mp3 new file mode 100644 index 0000000..2915771 Binary files /dev/null and b/Assets/Sounds/Jump/Jump05.mp3 differ diff --git a/Assets/Sounds/Jump/Jump05.mp3.meta b/Assets/Sounds/Jump/Jump05.mp3.meta new file mode 100644 index 0000000..b3f5c62 --- /dev/null +++ b/Assets/Sounds/Jump/Jump05.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 494197b7e4667cf429bef31c31392309 +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: