PitchChange of EnemyDeath Randomized

dev-ali
Ali Sharoz 2 months ago
parent 92b9a98bc3
commit b11b550b05

@ -167,9 +167,14 @@ namespace D2D.Gameplay
private void InitiateDeathSequence() private void InitiateDeathSequence()
{ {
Died?.Invoke(); Died?.Invoke();
if(!_isPlayer) if (!_isPlayer)
{ {
float pitch = UnityEngine.Random.Range(0.8f, 1.2f);
if (_enemySpawn.EnemyDeathAudio != null)
{
_enemySpawn.EnemyDeathAudio.pitch = pitch;
_enemySpawn.EnemyDeathAudio.Play(); _enemySpawn.EnemyDeathAudio.Play();
}
HapticPatterns.PlayPreset(HapticPatterns.PresetType.MediumImpact); HapticPatterns.PlayPreset(HapticPatterns.PresetType.MediumImpact);
} }
if (_isGrayFadeout) if (_isGrayFadeout)
@ -231,7 +236,7 @@ namespace D2D.Gameplay
if (healPoints <= 0) if (healPoints <= 0)
throw new Exception("Heal points should be positive!"); throw new Exception("Heal points should be positive!");
CurrentPoints = Math.Min(CurrentPoints+healPoints, _maxPoints); CurrentPoints = Math.Min(CurrentPoints + healPoints, _maxPoints);
} }
public void SetMaxPoints(float newMaxPoints, bool needRefill = false) public void SetMaxPoints(float newMaxPoints, bool needRefill = false)

@ -189447,7 +189447,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1984993047125568119, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} - target: {fileID: 1984993047125568119, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 2.2411957 value: 2.241211
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1991915019850540130, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} - target: {fileID: 1991915019850540130, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x

Loading…
Cancel
Save