public void InitializeAI() { gNPCController = GetComponent <NPCController>(); CurrentPathfinder = Pathfinders[SelectedPathfinder]; g_NextRecalculateTime = Time.time + PathRecalculationTime; InitBehaviorTree(); }
public void AddINPCPathfinderNode(INPCPathfinder ipf, NavNode node) { if (g_WalkedOnNodes.ContainsKey(ipf) && g_WalkedOnNodes[ipf] != node) { if (Application.isPlaying) { g_WalkedOnNodes[ipf].SetHighlightTile(false, Color.grey, 0.5f); } g_WalkedOnNodes.Remove(ipf); } else if (!g_WalkedOnNodes.ContainsKey(ipf)) { g_WalkedOnNodes.Add(ipf, node); if (Application.isPlaying) { node.SetHighlightTile(true, Color.red, 0.5f); } } }
public NavNode GetOccupiedNode(INPCPathfinder ipf) { return(g_WalkedOnNodes.ContainsKey(ipf) ? g_WalkedOnNodes[ipf] : null); }