Add CameraShake component and integrate with Health system; implement shake effect on damage taken

This commit is contained in:
2025-07-12 16:58:42 +02:00
parent 56592fa7ad
commit 4b68446ea9
6 changed files with 965 additions and 2 deletions

View File

@@ -14,6 +14,8 @@ namespace Systems
public GameObject LastAttacker => lastAttacker;
public event Action OnTakeDamage;
private void Start()
{
character.attributes.SetHealth(initialHealth);
@@ -24,6 +26,7 @@ namespace Systems
lastAttacker = attacker;
var effectiveDamage = Math.Max(damage - character.attributes.Armor, 1);
character.attributes.ModifyHealth(-effectiveDamage);
OnTakeDamage?.Invoke();
}
}
}