public override void SetAction(AIAction act)
    {
        base.SetAction(act);
        spiderBiteAction = (SpiderBiteAIAction)act;

        spider = (SpiderAIBehaviour)state.parent;

        state.agent.Stop();

        if(spider.timeSinceLastAttack > spiderBiteAction.minimumTimeSinceLastAttack)
        {
            spider.GetComponent<Animator>().SetTrigger("bite");
            spider.timeSinceLastAttack = 0f;
            spider.biting = true;
            discardedAttack = false;
        }
        else
        {
            discardedAttack = true;
        }
    }
Beispiel #2
0
    public override void SetAction(AIAction act)
    {
        base.SetAction(act);
        spiderBiteAction = (SpiderBiteAIAction)act;

        blackBoard.agent.Stop();

        if (spiderBlackBoard.timeSinceLastAttack > spiderBiteAction.minimumTimeSinceLastAttack)
        {
            blackBoard.attackAnimationEnded   = false;
            blackBoard.attackAnimationTrigger = false;
            blackBoard.animator.SetBool("moving", false);
            blackBoard.animator.SetTrigger("bite");
            spiderBlackBoard.timeSinceLastAttack = 0f;
            discardedAttack = false;
        }
        else
        {
            discardedAttack = true;
        }
    }