Exemple #1
0
 // These 2 methods will be used eventually if / when we get a director AI
 public void AddBehaviorSet <T>(T behaviorSet, bool sort = true) where T : BehaviorSet
 {
     if (BehaviorSets.TryAdd(typeof(T), behaviorSet) && sort)
     {
         SortActions();
     }
 }
Exemple #2
0
        // These 2 methods will be used eventually if / when we get a director AI
        public void AddBehaviorSet <T>(T behaviorSet, bool sort = true) where T : BehaviorSet
        {
            if (BehaviorSets.TryAdd(typeof(T), behaviorSet) && sort)
            {
                SortActions();
            }

            if (BehaviorSets.Count == 1 && !EntitySystem.Get <AiSystem>().IsAwake(this))
            {
                IoCManager.Resolve <IEntityManager>()
                .EventBus
                .RaiseEvent(EventSource.Local, new SleepAiMessage(this, false));
            }
        }