Exemplo n.º 1
0
 public override IEnumerator Enter(Machine owner, Brain controller)
 {
     mainMachine = owner;
     myBrain = controller;
     Legs myLegs = myBrain.legs;
     separation = new Separation(controller.allObjects);
     separation.Init(myLegs);
     random = new RandomWalk(1f, 1, 20);
     random.Init (myLegs);
     avoidWalls = new BoxAvoidance(controller.boxes, 3);
     avoidWalls.Init (myLegs);
     avoidWalls.setWeight(100);
     myLegs.addSteeringBehaviour(separation);
     myLegs.addSteeringBehaviour(random);
     myLegs.addSteeringBehaviour(avoidWalls);
     yield return null;
 }