Пример #1
0
    void Awake()
    {
        health = initialHealth;

        OnAwake();

        if (DamageHandler == null)
        {
            DamageHandler = OnTakeDamage;
        }

        if (DeathHandler == null)
        {
            DeathHandler = OnDeath;
        }
    }
 public void OnTakeDamage(TakeDamageData data)
 {
     OnTakeDamageHandler?.Invoke(data);
 }
Пример #3
0
 public void Register(OnTakeDamageHandler damage, OnDeathHandler death)
 {
     DamageHandler = damage;
     DeathHandler  = death;
 }