Ejemplo n.º 1
0
        public IBTExecutor GetExecutor(DataContext context, UnityEngine.Object actor)
        {
            context["actor"] = actor;

            var root = rootModel.Model;
            RecursiveLoadModelTree(rootModel, root);
            // TODO: Fetch an implementation from a factory
            return new CachingBtExecutor(root, context);
        }
Ejemplo n.º 2
0
 public void Merge(DataContext other)
 {
     foreach (var kvp in other.internalData) {
         if (this.internalData.ContainsKey(kvp.Key)) {
             continue;
         }
         this.internalData.Add(kvp.Key, kvp.Value);
     }
 }
Ejemplo n.º 3
0
 public IBTExecutor GetExecutor(DataContext overrideContext = null)
 {
     // recycle this for performance reasons but also to
     // persist the global context
     if (this.executor != null) {
         if (executor.GetStatus() != TaskStatus.UNINITIALISED) {
             executor.Terminate();
             executor.Reset();
         }
         if (overrideContext != null) {
             this.executor.SetRootContext(overrideContext);
         }
         return this.executor;
     }
     else {
         return this.GetExecutor(overrideContext != null ? overrideContext : new DataContext(globalDataContext), actor);
     }
 }