Example #1
0
 public IEnumerator DamageDealt(IDamagable damagable, string damageRegisterName)
 {
     while (damagable != null && _damageRegister.Contains(damageRegisterName))
     {
         if (GetComponent <Bullet>() != null)
         {
             Destroy(gameObject);
         }
         damagable.DecreaseHealth(_damage);
         yield return(new WaitForSeconds(0.2f));
     }
 }