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); }
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); } }
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); } }