public PatrolState(StateBlackboard blackboard, SetAnimTriggerAction setIdleAction, TimerAction timerAction, SetAnimTriggerAction setWalkAction, SetRandomDestinationAction setDestinationAction, MoveToDestinationAction moveToAction, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     actions.Add(setIdleAction);
     actions.Add(timerAction);
     actions.Add(setWalkAction);
     actions.Add(setDestinationAction);
     actions.Add(moveToAction);
 }
Exemple #2
0
        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));
        }
        public static PatrolState Create(StateBlackboard blackboard, Animator animator, NavMeshAgent navAgent, string idleTrigger, string runTrigger, Vector3 origin, float patrolRadius, float minWaitDuration, float maxWaitDuration, out SetAnimTriggerAction walkAction, bool randomWaitDuration = false)
        {
            SetAnimTriggerAction idleAction = new SetAnimTriggerAction(blackboard, animator, idleTrigger);

            walkAction = new SetAnimTriggerAction(blackboard, animator, runTrigger);
            SetRandomDestinationAction destinationAction = new SetRandomDestinationAction(blackboard, origin, patrolRadius);
            MoveToDestinationAction    moveToAction      = new MoveToDestinationAction(blackboard, navAgent);
            TimerAction timerAction = randomWaitDuration ? new TimerAction(blackboard, minWaitDuration, maxWaitDuration) : new TimerAction(blackboard, maxWaitDuration);

            return(new PatrolState(blackboard, idleAction, timerAction, walkAction, destinationAction, moveToAction));
        }
 public RangedAttackState(StateBlackboard blackboard, SetAnimTriggerAction idleAction, TimerAction timerAction, SetRandomDestinationAction destinationAction, SetAnimTriggerAction runAction, MoveToDestinationAction moveToAction, SetSkillAction setSkillAction, LookAtTargetAction lookAtAction, SetAnimTriggerAction attackAction, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     actions.Add(idleAction);
     actions.Add(timerAction);
     actions.Add(destinationAction);
     actions.Add(runAction);
     actions.Add(moveToAction);
     actions.Add(setSkillAction);
     actions.Add(lookAtAction);
     actions.Add(attackAction);
 }
Exemple #5
0
 public EnemyIdleState(StateBlackboard blackboard, SetAnimTriggerAction idleAction, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     this.idleAction = idleAction;
 }
Exemple #6
0
        public static EnemyIdleState Create(StateBlackboard blackboard, Animator animator, string idleTrigger, int priority)
        {
            SetAnimTriggerAction idleAction = new SetAnimTriggerAction(blackboard, animator, idleTrigger);

            return(new EnemyIdleState(blackboard, idleAction, priority));
        }
 public PlayerAttackState(StateBlackboard blackboard, SetAnimTriggerAction setAttackTrigger, SetAnimTriggerAction setNextAttackTrigger, LookAtTargetAction lookAtAction, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     this.setAttackTrigger     = setAttackTrigger;
     this.setNextAttackTrigger = setNextAttackTrigger;
     this.lookAtAction         = lookAtAction;
 }
Exemple #8
0
 public DeathState(StateBlackboard blackboard, SetAnimTriggerAction deathAction, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     this.deathAction = deathAction;
 }
Exemple #9
0
        public static DeathState Create(StateBlackboard blackboard, Animator animator, string deathTrigger, int priority)
        {
            SetAnimTriggerAction deathAction = new SetAnimTriggerAction(blackboard, animator, deathTrigger);

            return(new DeathState(blackboard, deathAction, priority));
        }
Exemple #10
0
        public static DamageState Create(StateBlackboard blackboard, Animator animator, string damageTrigger, int priority)
        {
            SetAnimTriggerAction damageAction = new SetAnimTriggerAction(blackboard, animator, damageTrigger, true);

            return(new DamageState(blackboard, damageAction, priority));
        }
Exemple #11
0
 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);
 }
Exemple #12
0
 public PlayerSkillState(StateBlackboard blackboard, SetAnimTriggerAction setSkillTrigger, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     this.setSkillTrigger = setSkillTrigger;
 }
 public PlayerMoveState(StateBlackboard blackboard, SetAnimTriggerAction setRunTriggerAction, SetMoveDirectionAction setMoveDirAction, MoveControllerAction moveControllerAction, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     this.setRunTriggerAction  = setRunTriggerAction;
     this.setMoveDirAction     = setMoveDirAction;
     this.moveControllerAction = moveControllerAction;
 }