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