EasyRoads3D V3 Manual |
ERRoadNetwork Description This is the base class for an EasyRoads3D road network
Constructors public ERRoadNetwork() Creates a new road network object in the scene or a reference to an already existing road network in the scene that was created manually in the Unity editor.
Static Properties public static ERRoadNetwork.RoadUpdateCallback onRoadUpdate Callback triggered after changes to a road object, including a reference to the changed ERRoad instance
public static ERRoadNetwork.SideObjectUpdate onSideObjectUpdate Callback triggered after changes to a side object, including a reference to the changed ERSideObjectInstance instance
public static ERRoadNetwork.BuildModeCallback onBuildModeEnter Callback triggered after switching to Build Mode
public static ERRoadNetwork.EditModeCallback onEditModeEnter Callback triggered after switching to Edit Mode
Functions
public void BuildRoadNetwork() Builds the final road network and manipulates the terrain accordingly
public void BuildRoadNetwork(bool splatmaps, bool trees, bool detail) Builds the final road network and manipulates the terrain according the passed parameters
public void BuildRoadNetwork(bool splatmaps, bool trees, bool detail, ERRoad[] roads) Builds the final road network and manipulates the terrain according the passed parameters. The terrain will only be updated according the passed array of road objects.
public void CenterPivotPoints() This will set the pivot points of all road objects to the center of the bounding box. This will be reset after each road update so it is recommended to use this only for testing and final builds.
public ERRoad ConnectRoads(ERRoad road1, ERRoad road2) Connects two roads at the nearest markers.
public ERRoad ConnectRoads(ERRoad road1, int markerIndex1, ERRoad road2, int markerIndex2) Connects two roads between markerIndex1 and markerIndex2.
public ERRoad CreateRoad(string name) Creates a new road object and returns it
public ERRoad CreateRoad(string name, Vector3[] markers) Creates and builds a new road object according the passed array of marker positons and returns it
public ERRoad CreateRoad(string name, ERRoadType type) Creates and a new road object of ERRoadType type and returns it
public ERRoad CreateRoad(string name, ERRoadType type, Vector3[] markers) Creates and builds a new road object of ERRoadType type and according the passed array of marker positons and returns it
public ERRoad CreateRoad(string name, ERRoadType type, Vector3[] markers, ERMarkerControlType[] controlTypes) Creates and builds a new road object of ERRoadType type, according the passed array of marker positons and marker shape control types and returns it
public void FinalizeObjects() This will remove all script components from all road network game objects including the main road network script.
public ERConnection GetConnectionByName(string name) Returns the connection in the scene matching name
public ERConnection[] GetConnections() Returns all available connections in the scene
public float GetRaiseOffset() Returns the raise level of the road network relative to the terrain height
public ERRoad[] GetRoadObjects() Returns all current road objects in the road network
public ERRoad GetRoadByGameObject(GameObject object) Finds a road object by GameObject and returns it
public ERRoad GetRoadByName(string name) Finds a road object by name and returns it
public ERRoadNetworkStatus GetRoadNetworkStatus() returns EditMode when the road network is in Edit Mode and BuildMode when the terrain is updated to the road network
public ERRoadType GetRoadTypeByName(string name) Returns a road type by name and returns it
public ERRoadType[] GetRoadTypes() Returns all available road types
public SideObject[] GetSideObjects() Returns all available side objects
public SideObject GetSideObjectByName(string name) Finds the side object by name and returns it
public bool SideObjectIsDualSided(SideObject obj) Returns true when the passed side object can be used on both sides of a road object
public ERConnection GetConnectionPrefabByName(string name) Returns the connection prefab in /Assets/EasyRoads3D/Resources/custom prefabs/ or /Assets/EasyRoads3D/Resources/dynamic prefabs/ matching name
public void HideWhiteSurfaces(bool value) Enables/disables visibility of the white surfaces surrounding the road objects
public ERConnection InstantiateConnection(ERConnection connectionPrefab, string name, Vector3 position, Vector3 euler) Instantiates, names and returns a new connection instance of the passed connectionPrefab, name, position and euler rotation angles
public ERConnection[] LoadConnections() Returns all available connections in the Resources folder
public void RestoreRoadNetwork() Restores the road network back to edit mode
public void ReadOSMData(XmlDocument osmDoc) This will parse the osm XML document and parse all road objects
public void SetOSMRoadType(string osmRoadType, ERRoadType erRoadType) This will link an OSM road type to an EasyRoads3D road type
public void SetRaiseOffset(float value) This will raise the road network in Build Mode above the terrain according the passed value
public void Translate(Vector3 translation) This will move the entire road network according the Vector3 translation
public void UpdateTerrainInfo() This will update the terrain data. Call this at runtime when new terrains are added to the scene and when these terrains should be updated according the road network shape.
|
|