diff --git a/Assets/Audio/Sound Effects/Death.bfxrsound b/Assets/Audio/Sound Effects/Death.bfxrsound new file mode 100644 index 0000000..e790a9d --- /dev/null +++ b/Assets/Audio/Sound Effects/Death.bfxrsound @@ -0,0 +1 @@ +1,0.5,,0.0341,,0.1644,0.3,0.7778,,-0.3023,,,,,,,,,,,,,,,,1,,,,,,,masterVolume \ No newline at end of file diff --git a/Assets/Audio/Sound Effects/Death.bfxrsound.meta b/Assets/Audio/Sound Effects/Death.bfxrsound.meta new file mode 100644 index 0000000..35ab150 --- /dev/null +++ b/Assets/Audio/Sound Effects/Death.bfxrsound.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fb45fa637e425ff4c800134e68f9a646 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Sound Effects/Death.wav b/Assets/Audio/Sound Effects/Death.wav new file mode 100644 index 0000000..db43afd Binary files /dev/null and b/Assets/Audio/Sound Effects/Death.wav differ diff --git a/Assets/Audio/Sound Effects/Death.wav.meta b/Assets/Audio/Sound Effects/Death.wav.meta new file mode 100644 index 0000000..e25f1f7 --- /dev/null +++ b/Assets/Audio/Sound Effects/Death.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 45157062ea57f1f4fb2271380bb846e4 +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/Audio/Sound Effects/Projectile Shot.bfxrsound b/Assets/Audio/Sound Effects/Projectile Shot.bfxrsound new file mode 100644 index 0000000..96d1340 --- /dev/null +++ b/Assets/Audio/Sound Effects/Projectile Shot.bfxrsound @@ -0,0 +1 @@ +1,0.5,,0.1319,,0.1193,0.3,0.4149,0.0348,-0.552,,,,,,,,,,,0.6014,-0.5053,,,,1,,,0.2598,,,,masterVolume \ No newline at end of file diff --git a/Assets/Audio/Sound Effects/Projectile Shot.bfxrsound.meta b/Assets/Audio/Sound Effects/Projectile Shot.bfxrsound.meta new file mode 100644 index 0000000..8c7ac2b --- /dev/null +++ b/Assets/Audio/Sound Effects/Projectile Shot.bfxrsound.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 82a5f8733e6ab5b42b342641ccdb06e1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Sound Effects/Projectile Shot.wav b/Assets/Audio/Sound Effects/Projectile Shot.wav new file mode 100644 index 0000000..6dcb1bc Binary files /dev/null and b/Assets/Audio/Sound Effects/Projectile Shot.wav differ diff --git a/Assets/Audio/Sound Effects/Projectile Shot.wav.meta b/Assets/Audio/Sound Effects/Projectile Shot.wav.meta new file mode 100644 index 0000000..837380b --- /dev/null +++ b/Assets/Audio/Sound Effects/Projectile Shot.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 1c6fb63523573864db38a1638bd01635 +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/Prefabs/Enemies/Basic Shooting Patrolling Enemy Variant.prefab b/Assets/Prefabs/Enemies/Basic Shooting Patrolling Enemy Variant.prefab index 58fa5c7..648d520 100644 --- a/Assets/Prefabs/Enemies/Basic Shooting Patrolling Enemy Variant.prefab +++ b/Assets/Prefabs/Enemies/Basic Shooting Patrolling Enemy Variant.prefab @@ -150,3 +150,104 @@ Transform: m_CorrespondingSourceObject: {fileID: 3234632762428300599, guid: c0a2079a443363b4da73a0d425221f6c, type: 3} m_PrefabInstance: {fileID: 3612889356597698756} m_PrefabAsset: {fileID: 0} +--- !u!1 &6102515708334491356 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7391517555913877016, guid: c0a2079a443363b4da73a0d425221f6c, type: 3} + m_PrefabInstance: {fileID: 3612889356597698756} + m_PrefabAsset: {fileID: 0} +--- !u!82 &-1472554968350166213 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6102515708334491356} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 8377903610078173799, guid: 55dad93ba7816e44c83798006fa0a277, type: 2} + m_audioClip: {fileID: 8300000, guid: 1c6fb63523573864db38a1638bd01635, type: 3} + m_PlayOnAwake: 0 + 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 diff --git a/Assets/Scripts/AI/ShootingEnemyAI.cs b/Assets/Scripts/AI/ShootingEnemyAI.cs index ff25773..b957925 100644 --- a/Assets/Scripts/AI/ShootingEnemyAI.cs +++ b/Assets/Scripts/AI/ShootingEnemyAI.cs @@ -21,6 +21,7 @@ namespace AI protected bool isShooting = false; protected IMovement movement = null; protected Animator animator = null; + protected AudioSource audioSource = null; protected int layerMask = ~(1 << 9); protected bool canShoot => target != null && (target.transform.position - transform.position).sqrMagnitude < attackRangeSquared; @@ -44,6 +45,7 @@ namespace AI { movement = transform.GetComponentInParent(); animator = transform.GetComponentInParent(); + audioSource = transform.GetComponentInParent(); UpdateTarget(FindObjectOfType()?.transform); } @@ -90,6 +92,7 @@ namespace AI projectile.SetVelocity(velocity); remainingCooldown = cooldownPerShoot; + audioSource.Play(); OnShoot?.Invoke(); }