Ejemplo n.º 1
0
    public override void PlayDead()
    {
        if (this.dead == true)
        {
            return;
        }

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

        dead = true;

        Follower f = this;

        while (f.follower != null)
        {
            f.follower.followIndex -= 1;
            f = f.follower;
        }

        if (this.prev is Hero)
        {
            ((Hero)this.prev).follower = this.follower;
        }
        else if (this.prev is Follower)
        {
            ((Follower)this.prev).follower = this.follower;
        }

        if (this.follower != null)
        {
            this.follower.prev = this.prev;
        }

        this.state = FollowState.DEAD;
        BattleControllor.RemoveFollower(this);

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

        this.model.PlayDead();

        StartCoroutine(Remove());
    }