Exemplo n.º 1
0
        private void Hit(GameObject target)
        {
            Hurtbox otherHurtbox = null;

            if (target != null)
            {
                otherHurtbox = target.GetComponent <Hurtbox>();
            }

            if (otherHurtbox != null)
            {
                if (!sourceTeam.IsAgainst(otherHurtbox.Team))
                {
                    otherHurtbox.GetHealed(healAmount);
                    DestroySelf();
                }
            }
        }
Exemplo n.º 2
0
        private void Hit(GameObject target)
        {
            Hurtbox otherHurtbox = null;

            if (target != null)
            {
                otherHurtbox = target.GetComponent <Hurtbox>();
            }

            if (otherHurtbox != null && !otherHurtbox.IsInvulnerable)
            {
                if (sourceTeam.IsAgainst(otherHurtbox.Team))
                {
                    onConnectEnemy.Invoke();
                    otherHurtbox.GetHit(damage);
                }
                else
                {
                    onConnectFriend.Invoke();
                }
            }
        }
Exemplo n.º 3
0
        private void Hit(GameObject target)
        {
            if (target != null)
            {
                Hurtbox otherHurtbox = target.GetComponent <Hurtbox>();

                if (otherHurtbox != null && !sourceTeam.IsAgainst(otherHurtbox.Team))
                {
                    otherHurtbox.GetHealed(healAmount);

                    onHeal.Invoke();

                    if (makeTargetEthereal)
                    {
                        EtherealStatus.Apply(target);
                    }

                    if (destroySelfOnHit)
                    {
                        Destroy(gameObject);
                    }
                }
            }
        }