Exemplo n.º 1
0
 /// <summary>
 /// 检查
 /// </summary>
 public void UpdateBehaviorType(MovingEntity entity, SteeringBehavior.Type_ type)
 {
     if (type == Type)
     {
         return;
     }
     Behavior = SteeringBehavior.Create(entity, type);
 }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
 public BehaviorWrapper(SteeringBehavior behavior, float pri, float weight)
 {
     Behavior = behavior;
     Priority = pri;
     Weight   = weight;
 }