Class TerrainLayer
Inherited Members
Namespace:Mapbox.Unity.Map
Assembly:cs.temp.dll.dll
Syntax
[Serializable]
public class TerrainLayer : AbstractLayer, IGlobeTerrainLayer, ITerrainLayer, ILayer
Constructors
TerrainLayer()
Declaration
public TerrainLayer()
TerrainLayer(ElevationLayerProperties)
Declaration
public TerrainLayer(ElevationLayerProperties properties)
Parameters
Type | Name | Description |
---|---|---|
ElevationLayerProperties | properties |
Properties
EarthRadius
Declaration
public float EarthRadius { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Implements
ElevationType
Declaration
public ElevationLayerType ElevationType { get; set; }
Property Value
Type | Description |
---|---|
ElevationLayerType |
Implements
ExaggerationFactor
Declaration
public float ExaggerationFactor { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Implements
Factory
Declaration
public AbstractTileFactory Factory { get; }
Property Value
Type | Description |
---|---|
AbstractTileFactory |
IsLayerActive
Declaration
public bool IsLayerActive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Implements
LayerProperty
Declaration
[NodeEditorElement("Terrain Layer")]
public ElevationLayerProperties LayerProperty { get; }
Property Value
Type | Description |
---|---|
ElevationLayerProperties |
LayerSource
Declaration
public ElevationSourceType LayerSource { get; }
Property Value
Type | Description |
---|---|
ElevationSourceType |
Implements
LayerSourceId
Declaration
public string LayerSourceId { get; }
Property Value
Type | Description |
---|---|
System.String |
Implements
LayerType
Declaration
public MapLayerType LayerType { get; }
Property Value
Type | Description |
---|---|
MapLayerType |
Implements
Methods
AddToUnityLayer(Int32)
Adds Terrain GameObject to Unity layer.
Declaration
public virtual void AddToUnityLayer(int layerId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | layerId | Layer identifier. |
Implements
DisableSideWalls()
Declaration
public void DisableSideWalls()
Implements
EnableCollider(Boolean)
Add/Remove terrain collider. Terrain uses mesh collider.
Declaration
public virtual void EnableCollider(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | Boolean for enabling/disabling mesh collider |
Implements
EnableSideWalls(Single, Material)
Turn on terrain side walls.
Declaration
public virtual void EnableSideWalls(float wallHeight, Material wallMaterial)
Parameters
Type | Name | Description |
---|---|---|
System.Single | wallHeight | Wall height. |
Material | wallMaterial | Wall material. |
Implements
Initialize()
Declaration
public void Initialize()
Implements
Initialize(LayerProperties)
Declaration
public void Initialize(LayerProperties properties)
Parameters
Type | Name | Description |
---|---|---|
LayerProperties | properties |
Implements
Remove()
Declaration
public void Remove()
Implements
RemoveFromUnityLayer(Int32)
Declaration
public void RemoveFromUnityLayer(int layerId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | layerId |
Implements
SetElevationType(ElevationLayerType)
Sets the main strategy for terrain mesh generation. Flat terrain doesn't pull data from servers and just uses a quad as terrain.
Declaration
public virtual void SetElevationType(ElevationLayerType elevationType)
Parameters
Type | Name | Description |
---|---|---|
ElevationLayerType | elevationType | Type of the elevation strategy |
Implements
SetExaggerationFactor(Single)
Sets the elevation multiplier for terrain. It'll regenerate terrain mesh, multiplying each point elevation by provided value.
Declaration
public virtual void SetExaggerationFactor(float factor)
Parameters
Type | Name | Description |
---|---|---|
System.Single | factor | Elevation multiplier |
Implements
SetLayerSource(ElevationSourceType)
Sets the data source for Terrain Layer. Defaults to MapboxTerrain. Use terrainSource = None, to disable the Terrain Layer.
Declaration
public virtual void SetLayerSource(ElevationSourceType terrainSource = ElevationSourceType.MapboxTerrain)
Parameters
Type | Name | Description |
---|---|---|
ElevationSourceType | terrainSource | Terrain source. |
Implements
SetLayerSource(String)
Sets the data source to a custom source for Terrain Layer.
Declaration
public virtual void SetLayerSource(string terrainSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | terrainSource | Terrain source. |
Implements
SetProperties(ElevationSourceType, ElevationLayerType, Boolean, Single, Int32)
Change terrain layer settings.
Declaration
public virtual 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 data source for the terrain height map. |
ElevationLayerType | elevationType | Mesh generation strategy for the tile/height. |
System.Boolean | enableCollider | Enable/Disable collider component for the tile game object. |
System.Single | factor | Multiplier for the height data. |
System.Int32 | layerId | Unity Layer for the tile game object. |
Implements
Update(LayerProperties)
Declaration
public void Update(LayerProperties properties)
Parameters
Type | Name | Description |
---|---|---|
LayerProperties | properties |