コード例 #1
0
    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);
        }
    }
コード例 #2
0
    public void Use()
    {
        if (canHeal && !isPressed)
        {
            healParticles.Play();
            //controller.AbilityStun(true);
            //StartCoroutine(HealOverTime());
            canHeal = false;
            healthController.Heal(healthBonus);
            playerUI?.AbilityCooldown(healTimeout, playerNr);
        }

        isPressed = true;
    }
コード例 #3
0
    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);
        }
    }