EasyRoads3D V3 Custom Crossings / Connections Part 2 [05-08-2015]
Beta 6.7 includes major changes to the custom crossings system, the system based on models, optionally your own models. More complex shapes can be generated with the new system, this video shows a road / train rail crossing.
The model we created in a modelling app, it includes two connections for the road and two connections for the train rail.
The Custom Crossing window is opened. This window is used to prepare models so they can be used within the EasyRoads3D system. The source model is dragged on the stage, it is analyzed and the geometry will be displayed on the stage. After clicking Build Connection Prefab, a new prefab with the same name will be created in /Assets/EasyRoads3D/Resources/custom crossings/
The first connection is added at the bottom by holding Shift + drag a rectangle around the points part of the connection. Aftewards the rail road material is assigned. The road type dropdown is empty, this means that currently no road types exists that match the selected connection geometry. A new road type "Rail Road" is created and instantly added to the road types list in the Inspector. The advantage of this is that this connection now has an active road type assigned, we can assign side objects to the road types and also instantly start new objects from this road type in the scene. Also, when you now select a connection matching this shape, the road type will be assigned automatically, no need to select the correct materials etc. This will also work for new custom prefabs from other models that have the same connection geometry structure.
The second connection is added on the left. Note: always add connections in clockwise direction! Just like with the train rail we create a new road type for this connection "Single Lane".
We add the remaining two connections, note that indeed the correct road types are now automatically assigned.
Click "Apply" to save the changes.
This is all that is required to make the model work within the EasyRoads3D system. In theory you can now start using this prefab and instantiate it in the scene from the 3rd crossings tab of the left in the Inspector.
However, you can customize these prefabs further, to do so the created prefab is dragged in the scene and the RailRoadCrossingsSignal model is added to it as a child.
Just like with ordinary Unity prefabs, "GameObject > Apply Changes To Prefab" is used to update the prefab in the assets folder.
The prefab is removed from the scene. Important: never use source prefabs directly in the scene!
The train rail crossing prefab is added to the scene, the exisiting road is connected and we pull out a new road from the other side. It will be a "Single Lane" road matching the road type we added in the Custom Crossing window.
We will now create the rail road tracks by pulling them out from the green connection handles. But first we want to adjust the created and assigned road type "Rail Road" a little bit. We will activate the side object "Train Rail Concrete" and use that as the ties between the train rails. The "Train Rail Concrete" side object is a standard Mesh Type of side object with a source model assigned. It is instantiated every 1m according the train rail shape.
A new train rail object is pulled out from the green handles. It isn't clearly visible at this point due to the offset on the shader used for the white surfaces.
"Build Terrain" is clicked to build the final road network and flatten the terrain accordingly. The white surfaces disappear and the rail road is clearly visible.