Add hit sounds

This commit is contained in:
Jens Pitkänen 2020-08-08 09:50:55 +03:00
parent 0a3ba11688
commit cbce3a6a7c
7 changed files with 210 additions and 11 deletions

View File

@ -1,5 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!244 &-3601797963847308308
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_EffectID: 7032a42d6a82a1847b2390082d6e806e
m_EffectName: Attenuation
m_MixLevel: 7dbfe66d31191674496b12611bd9cf3a
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!243 &-1410552352759146441
AudioMixerGroupController:
m_ObjectHideFlags: 0
@ -40,6 +54,7 @@ AudioMixerController:
- 3c6873f980b9fa3409038f22239e8ba7
- a1145e9de5e1d9d4980fbfb98ac09640
- c95b70575255b7444a07837f795dda0c
- 3a0a85f42d9d34f45a8e1b38e73db35a
name: View
m_CurrentViewIndex: 0
m_TargetSnapshot: {fileID: 24500006}
@ -103,6 +118,25 @@ AudioMixerEffectController:
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!243 &6277318630853483794
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Hits
m_AudioMixer: {fileID: 24100000}
m_GroupID: 3a0a85f42d9d34f45a8e1b38e73db35a
m_Children: []
m_Volume: 7418b82d7af9f19489c2a2ab41fbd325
m_Pitch: e655b4382fdf35945a6282ac03cd8f66
m_Send: 00000000000000000000000000000000
m_Effects:
- {fileID: -3601797963847308308}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!244 &7015759513254906842
AudioMixerEffectController:
m_ObjectHideFlags: 3
@ -128,6 +162,7 @@ AudioMixerGroupController:
m_GroupID: a1145e9de5e1d9d4980fbfb98ac09640
m_Children:
- {fileID: -1410552352759146441}
- {fileID: 6277318630853483794}
m_Volume: 1a91e250aa8fec749b1861a5c8e7ff48
m_Pitch: c21e265de00bfe64eba2868212c34fa2
m_Send: 00000000000000000000000000000000

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 92f50ea223ae4584d94d857571656599
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: e0e4bdf456a98d245a95bfcf948dc377
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:

View File

@ -309,7 +309,7 @@ AudioSource:
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
MaxDistance: 1000
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
@ -718,6 +718,7 @@ Transform:
- {fileID: 835288951058457063}
- {fileID: 7391558912167870012}
- {fileID: 4833458671639168932}
- {fileID: 5158433773336955785}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -790,8 +791,10 @@ MonoBehaviour:
Lean: 0
LaserPrefab: {fileID: 8009551885746485900, guid: 5c99da0361d098646b319a35fcc80095, type: 3}
Splatter: {fileID: 5204970423912589616}
AudioSource: {fileID: 3686721060470342146}
RaygunAudio: {fileID: 8300000, guid: 39b92d54fd06ad1419e7fb833ec9d43a, type: 3}
GunShotAudioSource: {fileID: 3686721060470342146}
RaygunClip: {fileID: 8300000, guid: 39b92d54fd06ad1419e7fb833ec9d43a, type: 3}
HitAudioSource: {fileID: 8513157977701802929}
HitClip: {fileID: 8300000, guid: e0e4bdf456a98d245a95bfcf948dc377, type: 3}
Pitch: 0
Yaw: 0
BodyYaw: 0
@ -1043,6 +1046,133 @@ BoxCollider:
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &8480591234863426618
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5158433773336955785}
- component: {fileID: 8513157977701802929}
m_Layer: 0
m_Name: HitSfx
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5158433773336955785
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8480591234863426618}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.75, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 7391558912774766616}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &8513157977701802929
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8480591234863426618}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 6277318630853483794, guid: ff7bf5284859d9f45a64971a67bb173a, type: 2}
m_audioClip: {fileID: 0}
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: 1
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 &8506552293636427135
GameObject:
m_ObjectHideFlags: 0
@ -1320,13 +1450,13 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6181022b324cabb40a9af0a5be0adb31, type: 3}
--- !u!198 &5204970423912589616 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 4926916423109787287, guid: 6181022b324cabb40a9af0a5be0adb31, type: 3}
m_PrefabInstance: {fileID: 892884152691873703}
m_PrefabAsset: {fileID: 0}
--- !u!4 &835288951058457063 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 572981381687391808, guid: 6181022b324cabb40a9af0a5be0adb31, type: 3}
m_PrefabInstance: {fileID: 892884152691873703}
m_PrefabAsset: {fileID: 0}
--- !u!198 &5204970423912589616 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 4926916423109787287, guid: 6181022b324cabb40a9af0a5be0adb31, type: 3}
m_PrefabInstance: {fileID: 892884152691873703}
m_PrefabAsset: {fileID: 0}

View File

@ -39,8 +39,10 @@ namespace NeonTea.Quakeball.Players {
public ParticleSystem Splatter;
[Header("Audio")]
public AudioSource AudioSource;
public AudioClip RaygunAudio;
public AudioSource GunShotAudioSource;
public AudioClip RaygunClip;
public AudioSource HitAudioSource;
public AudioClip HitClip;
[Header("Player rotation status")]
/// <summary>The pitch of the player's head.</summary>
@ -191,7 +193,7 @@ namespace NeonTea.Quakeball.Players {
Laser.From = GunPoint;
Laser.To = GunPoint + ShotDelta;
AudioSource.PlayOneShot(RaygunAudio);
GunShotAudioSource.PlayOneShot(RaygunClip);
}
public void Hit(ulong sourceUid) {
@ -204,6 +206,7 @@ namespace NeonTea.Quakeball.Players {
}
Debug.Log("I was hit! Aaagh!");
Splatter.Play();
HitAudioSource.PlayOneShot(HitClip);
}
public bool IsGrounded() {

View File

@ -1 +1,2 @@
- [Crosshair](Assets/Graphics/Sprites/Crosshair.png) by MarkieAnn Packer from the Noun Project
- [Sound effects](Assets/Audio/Sfx/ZapSplat) from [zapsplat.com](https://www.zapsplat.com/)