Beispiel #1
0
    public override void PlayDead()
    {
        if (this.dead == true)
        {
            return;
        }

        if (this.animator != null)
        {
            this.animator.SetInteger("State", 0);
        }

        BattleControllor.HeroDead(this);
        this.dead = true;

        Destroy(this.hpBar.gameObject);

        if (this.model == null)
        {
            return;
        }


        this.model.PlayDead();
    }
Beispiel #2
0
    public override void ChangeHP(float hp, bool crit)
    {
        this.attribute.hp -= hp;

        if (this.attribute.hp > this.attribute.maxHp)
        {
            this.attribute.hp = this.attribute.maxHp;
        }

        this.hpBar.SetHP(this.attribute.hp / this.attribute.maxHp);

        if (this.attribute.hp <= 0)
        {
            BattleControllor.HeroDead(this);
        }

        this.effectObject.PlayNum((int)hp, crit);
    }