Exemplo n.º 1
0
        public static void RoadNetworkLanesToMesh()
        {
            var roadNetworkDescription = GetSelectedRoadNetwork();

            if (roadNetworkDescription == null)
            {
                Debug.LogWarning("No RoadNetworkDescription selected.");
                return;
            }

            var go = RoadNetworkMesher.GenerateMeshWithLanes(roadNetworkDescription);

            AddRoadNetworkReference(go, roadNetworkDescription);
        }
        public void GenerateOpenDRIVELanesToMesh(string file)
        {
            testHelpers.GetTestRoadNetwork(file, out road);
            testHelpers.GenerateMeshTypeRoads(road, TestHelpers.MeshGenerationType.MeshRoad);

            var meshContainer = RoadNetworkMesher.GenerateMesh(road);
            var laneContainer = RoadNetworkMesher.GenerateMeshWithLanes(road);

            var roadContainer = new GameObject("TestOpenDRIVE");

            meshContainer.name             = "Mesh";
            laneContainer.name             = "Lanes";
            meshContainer.transform.parent = roadContainer.transform;
            laneContainer.transform.parent = roadContainer.transform;

            Assert.IsNotNull(roadContainer, "TestOpenDrive was never created");
            Assert.IsNotNull(meshContainer, "Mesh container was never created");
            Assert.IsNotNull(laneContainer, "Lane container was never created");
            Assert.IsNotEmpty(road.AllJunctions, "OpenDrive mesh doesn't junction contain data");
            Assert.IsNotEmpty(road.AllRoads, "OpenDrive mesh doesn't road contain data");
            LogAssert.NoUnexpectedReceived();
        }