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; } }
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; } }