Interface ITerrainLayer
Inherited Members
Namespace:Mapbox.Unity.Map
Assembly:cs.temp.dll.dll
Syntax
public interface ITerrainLayer : ILayer
Properties
ElevationType
Gets the Elevation Layer Type
for the TERRAIN
section.
Declaration
ElevationLayerType ElevationType { get; set; }
Property Value
Type | Description |
---|---|
ElevationLayerType |
ExaggerationFactor
Gets the Exaggeration Factor
for the TERRAIN
section.
Declaration
float ExaggerationFactor { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
LayerSource
Gets the Data Source
for the TERRAIN
section.
Declaration
ElevationSourceType LayerSource { get; }
Property Value
Type | Description |
---|---|
ElevationSourceType |
Methods
AddToUnityLayer(Int32)
Adds the terrain mesh GameObject to a Unity layer.
Declaration
void AddToUnityLayer(int layerId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | layerId | Layer identifier. You may need to add the layer in the Tags and Layers manager. |
DisableSideWalls()
Disables the settings for Show Sidewalls
.
Declaration
void DisableSideWalls()
EnableCollider(Boolean)
Enables or disables the Add Collider
settings for adding a collider
to the terrain. The collider type is a mesh collider.
Declaration
void EnableCollider(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | Boolean for toggling |
EnableSideWalls(Single, Material)
Enables the settings for Show Sidewalls
.
Declaration
void EnableSideWalls(float wallHeight, Material wallMaterial)
Parameters
Type | Name | Description |
---|---|---|
System.Single | wallHeight | Wall height. |
Material | wallMaterial | Wall material. |
RemoveFromUnityLayer(Int32)
Removes the terrain GameObject from a Unity layer.
Declaration
void RemoveFromUnityLayer(int layerId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | layerId | Layer identifier. |
SetElevationType(ElevationLayerType)
Sets the Elevation Layer Type
which is the main strategy for terrain
mesh generation. Flat Terrain
doesn't pull data from servers, it
uses a quad as the terrain.
Declaration
void SetElevationType(ElevationLayerType elevationType)
Parameters
Type | Name | Description |
---|---|---|
ElevationLayerType | elevationType | Type of the elevation. Can be set to |
SetExaggerationFactor(Single)
Sets the Exaggeration Factor
for the terrain. This acts as a multiplier
for elevation. Use this setting to better highlight elevation in your scene.
Each elevation point will be multiplied by the float value.
Declaration
void SetExaggerationFactor(float factor)
Parameters
Type | Name | Description |
---|---|---|
System.Single | factor | Elevation multiplier for |
SetLayerSource(ElevationSourceType)
Sets the Data Source for TERRAIN
. By default this is set to
Mapbox Terrain
. Currenly, only terrain-rgb is supported.
Use terrainSource = None
, to disable the terrain.
Declaration
void SetLayerSource(ElevationSourceType terrainSource = ElevationSourceType.MapboxTerrain)
Parameters
Type | Name | Description |
---|---|---|
ElevationSourceType | terrainSource |
|
SetProperties(ElevationSourceType, ElevationLayerType, Boolean, Single, Int32)
Change the TERRAIN
layer settings.
Declaration
void SetProperties(ElevationSourceType dataSource = ElevationSourceType.MapboxTerrain, ElevationLayerType elevationType = ElevationLayerType.TerrainWithElevation, bool enableCollider = false, float factor = 1F, int layerId = 0)
Parameters
Type | Name | Description |
---|---|---|
ElevationSourceType | dataSource | The |
ElevationLayerType | elevationType |
|
System.Boolean | enableCollider | Enables or disables |
System.Single | factor |
|
System.Int32 | layerId |
|