Ejemplo n.º 1
0
    public void Damage(IDamageSource hSource)
    {
        //DELETE?
        hRigidbody.useGravity = true;
        //DELETE?

        //Rigidbody hRigidbody = AddRigidbody();
        hRigidbody.velocity = hSource.GetDamage(Armor) * hSource.Owner.gameObject.transform.forward;
    }
Ejemplo n.º 2
0
        public void TakeDamage(IDamageSource damageSource)
        {
            if (Stats.IsDead())
            {
                return;
            }

            Stats.TakeDamage(damageSource.GetDamage());
            HandleDamage(damageSource);
            EmitHealthChanged();
            _damagePlayer.Play();

            if (Stats.IsDead())
            {
                Die();
            }
        }
Ejemplo n.º 3
0
    public override void Damage(IDamageSource hSource)
    {
        if (hSource.Owner == this)
            return;

        if (!CanTakeDamage)
            return;

        //dmgImgMGR.FlashIn();

        LastActor = hSource.Owner;

        this.currentHealth -= hSource.GetDamage(this.Armor);

        if (this.currentHealth <= 0f)
        {
            HealthBar.enabled = false;
            RpcDie(hSource.Owner.netId);
        }
    }