public void setBehaviour(SteeringBehaviourId id)
 {
     if (steeringBehaviours.ContainsKey(id))
     {
         currentBehaviour = steeringBehaviours[id];
     }
     else
     {
         Type type;
         bool found = behavioursMappings.TryGetValue(id, out type);
         if (found)
         {
             currentBehaviour       = (SteeringBehaviour)Activator.CreateInstance(type, owner);
             steeringBehaviours[id] = currentBehaviour;
         }
         else
         {
             throw new System.ArgumentException("Parameter behaviour id not recognised.", id.ToString());
         }
     }
 }
Esempio n. 2
0
 public void setBehaviour(SteeringBehaviourId behaviour)
 {
     steeringMovementModule.setBehaviour(behaviour);
 }