Ejemplo n.º 1
0
 public SetAnimFloatAction(StateBlackboard blackboard, Animator animator, float value, string paramName, BlackboardKey targetKey, bool delayFinish = false) : base(blackboard)
 {
     this.animator    = animator;
     this.paramName   = paramName;
     this.targetKey   = targetKey;
     this.delayFinish = delayFinish;
 }
Ejemplo n.º 2
0
 public SetAnimTriggerAction(StateBlackboard blackboard, Animator animator, string trigger, bool delayFinish = false) : base(blackboard)
 {
     this.animator    = animator;
     this.trigger     = trigger;
     this.delayFinish = delayFinish;
     this.isDynamic   = false;
 }
Ejemplo n.º 3
0
 public SetAnimTriggerAction(StateBlackboard blackboard, Animator animator, BlackboardKey triggerKey, bool delayFinish = false) : base(blackboard)
 {
     this.animator    = animator;
     this.delayFinish = delayFinish;
     this.triggerKey  = triggerKey;
     this.isDynamic   = true;
 }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
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));
        }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
        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));
        }
Ejemplo n.º 9
0
 public TimerAction(StateBlackboard blackboard, float minDuration, float maxDuration) : base(blackboard)
 {
     this.randomDuration = true;
     this.minDuration    = minDuration;
     this.maxDuration    = maxDuration;
 }
 public SetRandomDestinationAction(StateBlackboard blackboard, Vector3 origin, float radius) : base(blackboard)
 {
     this.origin = origin;
     this.radius = radius;
 }
Ejemplo n.º 11
0
 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;
 }
Ejemplo n.º 12
0
 public MoveControllerAction(StateBlackboard blackboard, CharacterController controller, float moveSpeed) : base(blackboard)
 {
     this.controller = controller;
     this.moveSpeed  = moveSpeed;
 }
Ejemplo n.º 13
0
 public MoveToDestinationAction(StateBlackboard blackboard, NavMeshAgent navAgent) : base(blackboard)
 {
     this.navAgent = navAgent;
 }
Ejemplo n.º 14
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));
        }
Ejemplo n.º 15
0
 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;
 }
Ejemplo n.º 16
0
 public SetMeleeAttackAction(StateBlackboard blackboard, MeleeAttackData[] meleeAttacks) : base(blackboard)
 {
     this.meleeAttacks = meleeAttacks;
 }
Ejemplo n.º 17
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));
        }
Ejemplo n.º 18
0
 public StateMachine(StateBlackboard blackboard, List <StateNode> stateNodes, BaseState initialState)
 {
     this.blackboard   = blackboard;
     this.stateNodes   = stateNodes;
     this.initialState = initialState;
 }
Ejemplo n.º 19
0
 public BaseState(StateBlackboard blackboard, int priority = 0, bool repeatable = false)
 {
     this.blackboard = blackboard;
     this.priority   = priority;
 }
Ejemplo n.º 20
0
 public PlayerSkillState(StateBlackboard blackboard, SetAnimTriggerAction setSkillTrigger, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     this.setSkillTrigger = setSkillTrigger;
 }
Ejemplo n.º 21
0
 public LookAtTargetAction(StateBlackboard blackboard, Transform transform) : base(blackboard)
 {
     this.transform = transform;
 }
Ejemplo n.º 22
0
 public TimerAction(StateBlackboard blackboard, float duration) : base(blackboard)
 {
     this.randomDuration = false;
     this.duration       = duration;
     this.minDuration    = this.maxDuration = 0;
 }
Ejemplo n.º 23
0
 public DeathState(StateBlackboard blackboard, SetAnimTriggerAction deathAction, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     this.deathAction = deathAction;
 }
Ejemplo n.º 24
0
 public SetSkillAction(StateBlackboard blackboard, EntitySkillController skillController) : base(blackboard)
 {
     this.skillController = skillController;
 }
Ejemplo n.º 25
0
 public SetMoveDirectionAction(StateBlackboard blackboard, Transform targetTransorm, Transform cameraTransform) : base(blackboard)
 {
     this.targetTransorm  = targetTransorm;
     this.cameraTransform = cameraTransform;
 }
Ejemplo n.º 26
0
 public MoveToTargetAction(StateBlackboard blackboard, NavMeshAgent navAgent, float stoppingDistance) : base(blackboard)
 {
     this.navAgent         = navAgent;
     this.stoppingDistance = stoppingDistance;
     isDynamic             = false;
 }
Ejemplo n.º 27
0
 public BaseAction(StateBlackboard blackboard)
 {
     this.blackboard = blackboard;
 }
Ejemplo n.º 28
0
 public MoveToTargetAction(StateBlackboard blackboard, NavMeshAgent navAgent, BlackboardKey key) : base(blackboard)
 {
     this.navAgent = navAgent;
     this.key      = key;
     isDynamic     = true;
 }
Ejemplo n.º 29
0
 public EnemyIdleState(StateBlackboard blackboard, SetAnimTriggerAction idleAction, int priority = 0, bool repeatable = false) : base(blackboard, priority, repeatable)
 {
     this.idleAction = idleAction;
 }
Ejemplo n.º 30
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));
        }