Ejemplo n.º 1
0
 void Start()
 {
     decisionTree = DecisionTree.Decision(
         AreWeContinuingMovement,
         ifTrue: DecisionTree.Action(ContinueJumpMovement),
         ifFalse: DecisionTree.Decision(
             AreWeFalling,
             ifTrue: DecisionTree.Action(JumpTowardsFloor),
             ifFalse: DecisionTree.Decision(
                 PlayerInAttackRange,
                 ifTrue: DecisionTree.Decision(
                     AreAttacksOnCooldown,
                     ifTrue: DecisionTree.Action(StepAway),
                     ifFalse: DecisionTree.Action(Attack)
                     ),
                 ifFalse: DecisionTree.Decision(
                     PlayerInAttackRangeIfWeTurn,
                     ifTrue: DecisionTree.Action(Turn),
                     ifFalse: DecisionTree.Decision(
                         ShouldWeDodgeProjectile,
                         ifTrue: DecisionTree.Action(DodgeProjectile),
                         ifFalse: DecisionTree.Decision(
                             ShouldWeSeekOutAPowerup,
                             ifTrue: DecisionTree.Action(MoveTowardsPowerup),
                             ifFalse: DecisionTree.Action(MoveTowardsPlayer)
                             )
                         )
                     )
                 )
             )
         );
 }