protected virtual void OnTriggerEnter2D(Collider2D other) { target = other.transform.root.GetComponent <Player_HealthController>(); //Hit the target if it is damageable if (target != null) { target.Heal(healthBonus); AudioManager1.instance.Play(healSound); Destroy(gameObject); } }
public void Use() { if (canHeal && !isPressed) { healParticles.Play(); //controller.AbilityStun(true); //StartCoroutine(HealOverTime()); canHeal = false; healthController.Heal(healthBonus); playerUI?.AbilityCooldown(healTimeout, playerNr); } isPressed = true; }
protected virtual void OnTriggerEnter2D(Collider2D other) { target = other.transform.root.GetComponent <Player_HealthController>(); //Hit the target if it is damageable if (target != null) { if (heal) { target.Heal(healthBonus); } else { target.Hit(damage, DamageType.physical, Vector2.zero, dmgStunTime); } Destroy(gameObject); } }