Skip to content

Commit e809f6f

Browse files
committed
feat: heal sound
1 parent 73adb38 commit e809f6f

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

Assets/Scenes/Reparation.unity

+107
Original file line numberDiff line numberDiff line change
@@ -11762,6 +11762,14 @@ PrefabInstance:
1176211762
propertyPath: health
1176311763
value: 100
1176411764
objectReference: {fileID: 0}
11765+
- target: {fileID: 2327224661414693905, guid: 6bacecc4f3df9584198879c73a6b6c36, type: 3}
11766+
propertyPath: healSound
11767+
value:
11768+
objectReference: {fileID: 8300000, guid: 5a61a9761a968cd42ab517241833a08a, type: 3}
11769+
- target: {fileID: 2327224661414693905, guid: 6bacecc4f3df9584198879c73a6b6c36, type: 3}
11770+
propertyPath: audioSource
11771+
value:
11772+
objectReference: {fileID: 1128651433}
1176511773
- target: {fileID: 3305085004668898818, guid: 6bacecc4f3df9584198879c73a6b6c36, type: 3}
1176611774
propertyPath: UI
1176711775
value:
@@ -11853,6 +11861,9 @@ PrefabInstance:
1185311861
- targetCorrespondingSourceObject: {fileID: 4459864850019384750, guid: 6bacecc4f3df9584198879c73a6b6c36, type: 3}
1185411862
insertIndex: -1
1185511863
addedObject: {fileID: 1128651432}
11864+
- targetCorrespondingSourceObject: {fileID: 4459864850019384750, guid: 6bacecc4f3df9584198879c73a6b6c36, type: 3}
11865+
insertIndex: -1
11866+
addedObject: {fileID: 1128651433}
1185611867
- targetCorrespondingSourceObject: {fileID: 4459864851310106424, guid: 6bacecc4f3df9584198879c73a6b6c36, type: 3}
1185711868
insertIndex: -1
1185811869
addedObject: {fileID: 848670200}
@@ -16385,6 +16396,102 @@ AudioSource:
1638516396
m_PreInfinity: 2
1638616397
m_PostInfinity: 2
1638716398
m_RotationOrder: 4
16399+
--- !u!82 &1128651433
16400+
AudioSource:
16401+
m_ObjectHideFlags: 0
16402+
m_CorrespondingSourceObject: {fileID: 0}
16403+
m_PrefabInstance: {fileID: 0}
16404+
m_PrefabAsset: {fileID: 0}
16405+
m_GameObject: {fileID: 635657467}
16406+
m_Enabled: 1
16407+
serializedVersion: 4
16408+
OutputAudioMixerGroup: {fileID: 0}
16409+
m_audioClip: {fileID: 0}
16410+
m_PlayOnAwake: 1
16411+
m_Volume: 1
16412+
m_Pitch: 1
16413+
Loop: 0
16414+
Mute: 0
16415+
Spatialize: 0
16416+
SpatializePostEffects: 0
16417+
Priority: 128
16418+
DopplerLevel: 1
16419+
MinDistance: 1
16420+
MaxDistance: 500
16421+
Pan2D: 0
16422+
rolloffMode: 0
16423+
BypassEffects: 0
16424+
BypassListenerEffects: 0
16425+
BypassReverbZones: 0
16426+
rolloffCustomCurve:
16427+
serializedVersion: 2
16428+
m_Curve:
16429+
- serializedVersion: 3
16430+
time: 0
16431+
value: 1
16432+
inSlope: 0
16433+
outSlope: 0
16434+
tangentMode: 0
16435+
weightedMode: 0
16436+
inWeight: 0.33333334
16437+
outWeight: 0.33333334
16438+
- serializedVersion: 3
16439+
time: 1
16440+
value: 0
16441+
inSlope: 0
16442+
outSlope: 0
16443+
tangentMode: 0
16444+
weightedMode: 0
16445+
inWeight: 0.33333334
16446+
outWeight: 0.33333334
16447+
m_PreInfinity: 2
16448+
m_PostInfinity: 2
16449+
m_RotationOrder: 4
16450+
panLevelCustomCurve:
16451+
serializedVersion: 2
16452+
m_Curve:
16453+
- serializedVersion: 3
16454+
time: 0
16455+
value: 0
16456+
inSlope: 0
16457+
outSlope: 0
16458+
tangentMode: 0
16459+
weightedMode: 0
16460+
inWeight: 0.33333334
16461+
outWeight: 0.33333334
16462+
m_PreInfinity: 2
16463+
m_PostInfinity: 2
16464+
m_RotationOrder: 4
16465+
spreadCustomCurve:
16466+
serializedVersion: 2
16467+
m_Curve:
16468+
- serializedVersion: 3
16469+
time: 0
16470+
value: 0
16471+
inSlope: 0
16472+
outSlope: 0
16473+
tangentMode: 0
16474+
weightedMode: 0
16475+
inWeight: 0.33333334
16476+
outWeight: 0.33333334
16477+
m_PreInfinity: 2
16478+
m_PostInfinity: 2
16479+
m_RotationOrder: 4
16480+
reverbZoneMixCustomCurve:
16481+
serializedVersion: 2
16482+
m_Curve:
16483+
- serializedVersion: 3
16484+
time: 0
16485+
value: 1
16486+
inSlope: 0
16487+
outSlope: 0
16488+
tangentMode: 0
16489+
weightedMode: 0
16490+
inWeight: 0.33333334
16491+
outWeight: 0.33333334
16492+
m_PreInfinity: 2
16493+
m_PostInfinity: 2
16494+
m_RotationOrder: 4
1638816495
--- !u!4 &1130256303 stripped
1638916496
Transform:
1639016497
m_CorrespondingSourceObject: {fileID: -5819118886272102141, guid: e0f672a015f8fee418afd70dfd718f0d, type: 3}

Assets/Scripts/Health.cs

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public class Health : MonoBehaviour
88
public float health = 100f;
99
public List<int> damageValues = new();
1010
private int _currentDamageIndex;
11+
public AudioSource audioSource;
12+
public AudioClip healSound;
1113

1214
public Text healthText;
1315

@@ -29,6 +31,7 @@ private void OnTriggerEnter(Collider other)
2931

3032
if (!other.CompareTag("Kit") || !(health < 100f)) return;
3133
StartCoroutine(Heal(5f));
34+
audioSource.PlayOneShot(healSound);
3235
Destroy(other.gameObject);
3336
}
3437

469 KB
Binary file not shown.

0 commit comments

Comments
 (0)