Sounds Addition

dev-ali
Ali Sharoz 2 months ago
parent 1eb0a47634
commit faf59d6815

@ -166,7 +166,10 @@ namespace D2D.Gameplay
private void InitiateDeathSequence() private void InitiateDeathSequence()
{ {
Died?.Invoke(); Died?.Invoke();
if(!_isPlayer)
{
_enemySpawn.EnemyDeathAudio.Play();
}
if (_isGrayFadeout) if (_isGrayFadeout)
{ {
GrayFadeoutDeath(); GrayFadeoutDeath();

@ -0,0 +1,29 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ButtonSoundClick : MonoBehaviour
{
public AudioSource audioSource;
public Button[] allButtons;
private void Start()
{
Starter();
}
void Starter()
{
allButtons = FindObjectsOfType<Button>(true);
for (int i = 0; i < allButtons.Length; i++)
{
allButtons[i].onClick.AddListener(() =>
{
PlayClickSound();
});
}
}
void PlayClickSound()
{
audioSource.Play();
}
}

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e53a137afcf13a647835ecca96e4f0ee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,145 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6525206132795089898
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9190314266057098784}
- component: {fileID: 6462627113827653938}
- component: {fileID: 3517654243002896153}
m_Layer: 0
m_Name: ButtonSoundClick
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &9190314266057098784
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6525206132795089898}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 177.37555, y: 676.8981, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &6462627113827653938
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6525206132795089898}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 3664849a4c3402e45b94eddf007ccf7f, 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
--- !u!114 &3517654243002896153
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6525206132795089898}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e53a137afcf13a647835ecca96e4f0ee, type: 3}
m_Name:
m_EditorClassIdentifier:
audioSource: {fileID: 6462627113827653938}
allButtons: []

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1a531a81fa7b17f4fa4409accee70bb6
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -148384,6 +148384,63 @@ Transform:
- {fileID: 998314399} - {fileID: 998314399}
m_Father: {fileID: 1151035127} m_Father: {fileID: 1151035127}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1688528664
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6525206132795089898, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_Name
value: ButtonSoundClick
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalPosition.x
value: 177.37555
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalPosition.y
value: 676.8981
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
--- !u!1 &1688866770 --- !u!1 &1688866770
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -156065,6 +156122,134 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1790090224} m_GameObject: {fileID: 1790090224}
m_Mesh: {fileID: 7155393321614783075, guid: 9fd0f55393884024ebcfbf36252b5471, type: 3} m_Mesh: {fileID: 7155393321614783075, guid: 9fd0f55393884024ebcfbf36252b5471, type: 3}
--- !u!1 &1790654129
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1790654131}
- component: {fileID: 1790654130}
m_Layer: 0
m_Name: EnemyDeathAudio
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!82 &1790654130
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1790654129}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 61db396f1616c584ba14abece7f84ef1, 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
--- !u!4 &1790654131
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1790654129}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 348.76413, y: 244.37341, z: -1213.6832}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1791387586 --- !u!1 &1791387586
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -189198,6 +189383,10 @@ PrefabInstance:
propertyPath: m_TargetGraphic propertyPath: m_TargetGraphic
value: value:
objectReference: {fileID: 1584765848} objectReference: {fileID: 1584765848}
- target: {fileID: 2573263788687539819, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3}
propertyPath: m_PreserveAspect
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2661376638078344898, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} - target: {fileID: 2661376638078344898, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 1
@ -190071,6 +190260,10 @@ PrefabInstance:
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -23.9 value: -23.9
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7037153449291987478, guid: 1b2e5360cddaa1548807141331917a93, type: 3}
propertyPath: EnemyDeathAudio
value:
objectReference: {fileID: 1790654130}
- target: {fileID: 7129349024175210864, guid: 1b2e5360cddaa1548807141331917a93, type: 3} - target: {fileID: 7129349024175210864, guid: 1b2e5360cddaa1548807141331917a93, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: Level 1 value: Level 1
@ -190485,3 +190678,5 @@ SceneRoots:
- {fileID: 1533045682} - {fileID: 1533045682}
- {fileID: 502168398} - {fileID: 502168398}
- {fileID: 1587148440} - {fileID: 1587148440}
- {fileID: 1688528664}
- {fileID: 1790654131}

@ -64350,6 +64350,63 @@ MonoBehaviour:
m_StringArgument: m_StringArgument:
m_BoolArgument: 1 m_BoolArgument: 1
m_CallState: 2 m_CallState: 2
--- !u!1001 &2100858625856836009
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6525206132795089898, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_Name
value: ButtonSoundClick
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalPosition.x
value: 177.37555
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalPosition.y
value: 676.8981
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9190314266057098784, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1a531a81fa7b17f4fa4409accee70bb6, type: 3}
--- !u!1001 &4415650502532578320 --- !u!1001 &4415650502532578320
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -64513,3 +64570,4 @@ SceneRoots:
- {fileID: 943020264} - {fileID: 943020264}
- {fileID: 1091084106} - {fileID: 1091084106}
- {fileID: 726687768} - {fileID: 726687768}
- {fileID: 2100858625856836009}

Binary file not shown.

@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 3664849a4c3402e45b94eddf007ccf7f
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 61db396f1616c584ba14abece7f84ef1
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

@ -207,7 +207,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: 24a1bce5a276fd34388464df1125cc5d, type: 3} m_Sprite: {fileID: 21300000, guid: 24a1bce5a276fd34388464df1125cc5d, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 1
m_FillCenter: 1 m_FillCenter: 1
m_FillMethod: 4 m_FillMethod: 4
m_FillAmount: 1 m_FillAmount: 1
@ -611,7 +611,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 616049456, guid: a7a08bd8988f4be4498ee0bbdef80622, type: 3} m_Sprite: {fileID: 616049456, guid: a7a08bd8988f4be4498ee0bbdef80622, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 1
m_FillCenter: 1 m_FillCenter: 1
m_FillMethod: 4 m_FillMethod: 4
m_FillAmount: 1 m_FillAmount: 1

@ -68,7 +68,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: 997798bc0b354ea45a0379a10d665512, type: 3} m_Sprite: {fileID: 21300000, guid: 997798bc0b354ea45a0379a10d665512, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 1
m_FillCenter: 1 m_FillCenter: 1
m_FillMethod: 4 m_FillMethod: 4
m_FillAmount: 1 m_FillAmount: 1
@ -148,7 +148,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: dfe68acfdee96eb41ac8041a55a8b842, type: 3} m_Sprite: {fileID: 21300000, guid: dfe68acfdee96eb41ac8041a55a8b842, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 1
m_FillCenter: 1 m_FillCenter: 1
m_FillMethod: 4 m_FillMethod: 4
m_FillAmount: 1 m_FillAmount: 1
@ -282,7 +282,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: 5f89e0ac9e138fc49be9c3ffc4aaa5cc, type: 3} m_Sprite: {fileID: 21300000, guid: 5f89e0ac9e138fc49be9c3ffc4aaa5cc, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 1
m_FillCenter: 1 m_FillCenter: 1
m_FillMethod: 4 m_FillMethod: 4
m_FillAmount: 1 m_FillAmount: 1
@ -492,7 +492,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: b733e1e0c8d889b4bb75769ee8b8b007, type: 3} m_Sprite: {fileID: 21300000, guid: b733e1e0c8d889b4bb75769ee8b8b007, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 1
m_FillCenter: 1 m_FillCenter: 1
m_FillMethod: 4 m_FillMethod: 4
m_FillAmount: 1 m_FillAmount: 1

@ -8,6 +8,7 @@ using static D2D.Utilities.CommonGameplayFacade;
public class EnemySpawn : Unit public class EnemySpawn : Unit
{ {
public AudioSource EnemyDeathAudio;
[SerializeField] private int maxEnemiesOnField; [SerializeField] private int maxEnemiesOnField;
[SerializeField] private float delayBetweenSpawn = .4f; [SerializeField] private float delayBetweenSpawn = .4f;

Loading…
Cancel
Save