Esempio n. 1
0
    /// <summary>
    /// Creates a GameObject representing the supplied path.
    /// </summary>
    /// <param name="path">List of nodes in path order</param>
    /// <returns>The generated GameObject.</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));
    }
Esempio n. 2
0
    /// <summary>
    /// Creates a Road Lattice debug object for currently loaded map, and clears any partial path
    /// finding display and state.
    /// </summary>
    /// <remarks>
    /// Configured through the Unity editor as a handler for the DidModifyLattice event.
    /// </remarks>
    /// <param name="args">Map loaded arguments</param>
    public void HandleDidModifyLattice(DidModifyRoadLatticeArgs args)
    {
        if (RoadLatticeDebugObject != null)
        {
            Destroy(RoadLatticeDebugObject);
        }

        RoadLatticeDebugObject = RoadLatticeTools.MakeRoadLatticeDebugGameObject(
            args.RoadLattice, LatticeMaterials, IndicateNodes, ShowPartitioned);
        RoadLatticeDebugObject.transform.Translate(Vector3.up * LatticeDisplayY);
        RoadLatticeDebugObject.transform.SetParent(transform, false);
    }