/// <summary> /// Debug feature: used to display the active path between the agent and its target. /// </summary> /// <param name="path">The path to create a display from.</param> /// <returns>The route display object.</returns> private GameObject MakeRouteDisplay(IList <RoadLatticeNode> path) { List <Vector2> vertices = new List <Vector2>(); foreach (RoadLatticeNode node in path) { vertices.Add(node.Location); } return(RoadLatticeTools.MakePathDebugObject(vertices, PathDisplayWidth, PathMaterial)); }
/// <summary> /// MapLoaded handler that creates a Road Lattice debug object for currently loaded map. /// </summary> /// <param name="args">Map loaded arguments</param> public void ShowRoadLattice(DidModifyRoadLatticeArgs args) { if (RoadLatticeDebugObject != null) { Destroy(RoadLatticeDebugObject); } RoadLatticeDebugObject = RoadLatticeTools.MakeAttributedLatticeDebugGameObject( args.RoadLattice, LatticeMaterials, IndicateNodes); RoadLatticeDebugObject.transform.Translate(Vector3.up); RoadLatticeDebugObject.transform.SetParent(transform, false); }
/// <summary> /// RoadLattice handler that creates a Road Lattice debug object for currently loaded map. /// </summary> /// <param name="args">RoadLattice event data</param> void OnModifiedRoadLattice(DidModifyRoadLatticeArgs args) { if (RoadLattice != null) { // Deletes the previous road lattice debug object if (RoadLatticeDebugObject != null) { Destroy(RoadLatticeDebugObject); } RoadLatticeDebugObject = RoadLatticeTools.MakeRoadLatticeDebugGameObject( args.RoadLattice, LatticeMaterials, IndicateNodes, ShowPartitioned); RoadLatticeDebugObject.transform.Translate(Vector3.up); RoadLatticeDebugObject.transform.SetParent(RoadLattice.transform, false); } }