public HashSet <PuppeteerAgent> GetAgents() { #if UNITY_EDITOR m_Agents.Clear(); // Agents only register themselves in play mode. // Since I don't want them to run in edit mode, we have to find them. PuppeteerRuntimeHelper.AddAllToHashSet(ref m_Agents, UnityEngine.Object.FindObjectsOfType <PuppeteerAgent>()); #endif return(m_Agents); }
public void CreatePlanHierarchy(PlannerNode <TKey, TValue> _finalPathNode, IEnumerable <PlannerNode <TKey, TValue> > _openNodes, IEnumerable <PlannerNode <TKey, TValue> > _closedNodes) { List <PlannerHierarchyNodePair <TKey, TValue> > nodePairs = new List <PlannerHierarchyNodePair <TKey, TValue> >(); PuppeteerRuntimeHelper.CreateNodePairsForClosedNodes(_closedNodes, ref nodePairs); var goalNodePair = nodePairs.Find(_entry => _entry.PlannerNodeInstance.GetParent() == null); m_RootHierarchyNode = goalNodePair?.HierarchyNodeInstance; PuppeteerRuntimeHelper.CreateNodePairsForOpenNodes(_openNodes, ref nodePairs); PuppeteerRuntimeHelper.CreateNodePairForLastOpenNode(ref _finalPathNode, ref nodePairs); var lastHierarchyNode = nodePairs.Last().HierarchyNodeInstance; PuppeteerRuntimeHelper.ConstructHierarchy(ref nodePairs); PuppeteerRuntimeHelper.SetPartOfFoundPathRecursive(lastHierarchyNode); }