Пример #1
0
 /// <summary>
 /// 检查
 /// </summary>
 public void UpdateBehaviorType(MovingEntity entity, SteeringBehavior.Type_ type)
 {
     if (type == Type)
     {
         return;
     }
     Behavior = SteeringBehavior.Create(entity, type);
 }
Пример #2
0
        public void AddBehavior(SteeringBehavior behavior, float priority, float weight)
        {
            if (behavior == null)
            {
                Debug.LogError("Behavior = null");
            }
            bool isContain = false;

            foreach (var b in Behaviors)
            {
                if (b.Type == behavior.Type)
                {
                    Debug.LogError("Has Behavior: " + behavior.Type.ToString());
                    return;
                }
            }
            Behaviors.Add(new BehaviorWrapper(behavior, priority, weight));
        }
Пример #3
0
 public BehaviorWrapper(SteeringBehavior behavior, float pri, float weight)
 {
     Behavior = behavior;
     Priority = pri;
     Weight   = weight;
 }