Custom crossings or connection prefabs are mesh models imported into the system.
General Settings Tab > Crossing Connection Prefabs > Custom Prefab Editor Window
This is a powerful tool which makes it possible to create your own unique road networks. It is a tool by itself that can also be used for non road related objects. For instance the sewer system in the demo project was done this way. Or the rail road track.
New tutorials will follow soon, below are the provional beta videos.
|00:00||The model we created in a modelling app, it includes two connections for the road and two connections for the train rail.|
|00:15||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/|
|00:50||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.|
|01:32||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".|
|01:55||We add the remaining two connections, note that indeed the correct road types are now automatically assigned.|
|02:13||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.|
|02:43||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.|
|03:35||Just like with ordinary Unity prefabs, "GameObject > Apply Changes To Prefab" is used to update the prefab in the assets folder.|
|03:47||The prefab is removed from the scene. Important: never use source prefabs directly in the scene!|
|04:05||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.|
|04:55||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.|
|05:50||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.|
|07:05||"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.|