public MeleeAttackState(StateBlackboard blackboard, SetMeleeAttackAction setMeleeAttackAction, SetAnimTriggerAction walkAction, MoveToTargetAction moveToAction, LookAtTargetAction lookAtAction, SetAnimTriggerAction attackAction, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable) { actions.Add(setMeleeAttackAction); actions.Add(walkAction); actions.Add(moveToAction); actions.Add(lookAtAction); actions.Add(attackAction); }
public static MeleeAttackState Create(StateBlackboard blackboard, Animator animator, NavMeshAgent navAgent, MeleeAttackData[] meleeAttacks, Transform transform, BlackboardKey attackRangeKey, BlackboardKey attackTriggerKey, SetAnimTriggerAction walkAction, int priority) { SetMeleeAttackAction setMeleeAttackAction = new SetMeleeAttackAction(blackboard, meleeAttacks); MoveToTargetAction moveToTargetAction = new MoveToTargetAction(blackboard, navAgent, attackRangeKey); LookAtTargetAction lookAtAction = new LookAtTargetAction(blackboard, transform); SetAnimTriggerAction attackAction = new SetAnimTriggerAction(blackboard, animator, attackTriggerKey, true); return(new MeleeAttackState(blackboard, setMeleeAttackAction, walkAction, moveToTargetAction, lookAtAction, attackAction, priority)); }