Exemple #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;
 }
 public Int32 GetHashCode(TEnum firstEnum)
 {
     return(BoxAvoidance.ToInt(firstEnum));
 }
 public Boolean Equals(TEnum firstEnum, TEnum secondEnum)
 {
     return(BoxAvoidance.ToInt(firstEnum) == BoxAvoidance.ToInt(secondEnum));
 }