void Awake() { health = initialHealth; OnAwake(); if (DamageHandler == null) { DamageHandler = OnTakeDamage; } if (DeathHandler == null) { DeathHandler = OnDeath; } }
public void OnTakeDamage(TakeDamageData data) { OnTakeDamageHandler?.Invoke(data); }
public void Register(OnTakeDamageHandler damage, OnDeathHandler death) { DamageHandler = damage; DeathHandler = death; }