Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class HexTerrainAPI

    Example implementation of the IHexTerrainAPI interface. Used to be injected into places without access to the EntityManager. Abstracts user code from the TerrainData storage (usually the Entity World). Provides an API for working with a terrain. Usually uses in a UserTools (brushes, etc.).

    Inheritance
    object
    HexTerrainAPI
    Implements
    IHexTerrainAPI
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Fwt.HexTerrains
    Assembly: fwt.hexterrains.dll
    Syntax
    public class HexTerrainAPI : IHexTerrainAPI

    Fields

    _heightmapPalette

    Cached list of Heightmap textures retrieved from the UserToolEntity.

    Declaration
    protected IList<Texture2D> _heightmapPalette
    Field Value
    Type Description
    IList<Texture2D>

    _terrainPrefabConfigs

    Cached list of terrain prefab configs attached to UserToolEntity.

    Declaration
    protected IList<IHexTerrainPrefabConfig> _terrainPrefabConfigs
    Field Value
    Type Description
    IList<IHexTerrainPrefabConfig>

    Properties

    EntityManager

    Cached EntityManager. Used to access the Entity World. Performs operations on the TerrainEntity TerrainEntity

    Declaration
    public EntityManager EntityManager { get; set; }
    Property Value
    Type Description
    EntityManager

    EnvironmentAPI

    Gets or sets the environment API used to interact with environment-related functionality.

    Declaration
    public IEnvironmentAPI EnvironmentAPI { get; set; }
    Property Value
    Type Description
    IEnvironmentAPI

    TerrainEntity

    Cached terrain terrainEntity. Feel free to replace it's value, as everything is extracted from Entity World using this terrainEntity for every API function call. So if this terrainEntity is changed, the API will work with a new terrainEntity. If this terrainEntity does not exist, the API calls will not work, but will not throw an exception.

    Declaration
    public Entity TerrainEntity { get; set; }
    Property Value
    Type Description
    Entity

    UISystemAPI

    Cached UISystemAPI. Used to access the UI system.

    Declaration
    public IUISystemAPI UISystemAPI { get; set; }
    Property Value
    Type Description
    IUISystemAPI

    UserToolEntity

    Cached UserToolEntity this user tool is controlled by

    Declaration
    public Entity UserToolEntity { get; set; }
    Property Value
    Type Description
    Entity

    Methods

    CreateNewTerrainEntity(Entity)

    Creates a new terrain terrainEntity by instantiating provided prefab.

    Declaration
    public virtual Entity CreateNewTerrainEntity(Entity terrainPrefab)
    Parameters
    Type Name Description
    Entity terrainPrefab

    prefab of the terrainEntity to create

    Returns
    Type Description
    Entity

    instance of the created terrainEntity

    CreateNewTerrain<TPrefabConfig>(TPrefabConfig, HexTerrainSettings)

    Creates a new terrain entity with the specified settings. Destroys existing terrain

    Declaration
    public virtual Entity CreateNewTerrain<TPrefabConfig>(TPrefabConfig terrainPrefabConfig, HexTerrainSettings terrainSettings) where TPrefabConfig : IHexTerrainPrefabConfig
    Parameters
    Type Name Description
    TPrefabConfig terrainPrefabConfig

    prefab config of the terrainEntity to create

    HexTerrainSettings terrainSettings

    terrain settings to overwrite

    Returns
    Type Description
    Entity

    instance of the created terrainEntity

    Type Parameters
    Name Description
    TPrefabConfig

    CreateUIScreen<TScreen>()

    Creates a new screen of the specified type.

    Declaration
    public virtual TScreen CreateUIScreen<TScreen>() where TScreen : UIScreen
    Returns
    Type Description
    TScreen

    screen instance

    Type Parameters
    Name Description
    TScreen

    type of the screen to create

    DestroyTerrain(Entity)

    Destroys a terrain entity provided.

    Declaration
    public virtual bool DestroyTerrain(Entity terrainEntity)
    Parameters
    Type Name Description
    Entity terrainEntity

    terrain entity to destroy

    Returns
    Type Description
    bool

    true if was destroyed, otherwise - false

    DestroyUIScreen(UIScreen)

    Destroys the specified screen instance.

    Declaration
    public virtual bool DestroyUIScreen(UIScreen screen)
    Parameters
    Type Name Description
    UIScreen screen

    screen instance to destroy

    Returns
    Type Description
    bool

    true if the screen was destroyed successfully; otherwise, false

    DestroyUIScreen<TScreen>()

    Destroys the specified screen.

    Declaration
    public virtual bool DestroyUIScreen<TScreen>() where TScreen : UIScreen
    Returns
    Type Description
    bool

    true if the screen was destroyed successfully; otherwise, false

    Type Parameters
    Name Description
    TScreen

    type of a screen to destroy

    GetBrushColor()

    Returns the brush color from the TerrainEntity HexTerrainBrush.

    Declaration
    public virtual Color32? GetBrushColor()
    Returns
    Type Description
    Color32?

    brush color if found, otherwise - false

    GetBrushOpacity()

    Returns the brush opacity from the TerrainEntity HexTerrainBrush.

    Declaration
    public virtual float? GetBrushOpacity()
    Returns
    Type Description
    float?

    brush opacity if brush is found, otherwise - null

    GetBrushSize()

    Returns the brush size from the TerrainEntity HexTerrainBrush.

    Declaration
    public virtual int? GetBrushSize()
    Returns
    Type Description
    int?

    brush size if found, otherwise - null

    GetBrushView()

    Returns the brush view from the TerrainEntity HexTerrainBrushView.

    Declaration
    public virtual HexTerrainBrushView GetBrushView()
    Returns
    Type Description
    HexTerrainBrushView

    brush view from the TerrainEntity if found, otherwise - null

    GetCellBiome<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the BiomeMap value at the specified cell index from the specified ChunkMeshLayer.

    Declaration
    public virtual int? GetCellBiome<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : ChunkMeshLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    int?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the ChunkMeshLayer from

    TLayer

    type of ChunkMeshLayer from the HexTerrainLayerGroup to get a cell value from

    GetCellCoordUnderCursor()

    Returns the cell coordinate under the cursor.

    Declaration
    public virtual int2? GetCellCoordUnderCursor()
    Returns
    Type Description
    int2?

    cell coordinate if found and raycast hit the terrain, otherwise - false

    GetCellEntity<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the EntityMap value at the specified cell index from the specified CellEntityLayer.

    Declaration
    public virtual int? GetCellEntity<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellEntityLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    int?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellEntityLayer from

    TLayer

    type of CellEntityLayer from the HexTerrainLayerGroup to get a cell value from

    GetCellHeight<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the HeightMap value at the specified cell index from the specified ChunkMeshLayer.

    Declaration
    public virtual float? GetCellHeight<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : ChunkMeshLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    float?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the ChunkMeshLayer from

    TLayer

    type of ChunkMeshLayer from the HexTerrainLayerGroup to get a cell value from

    GetCellIndexUnderCursor()

    Returns the cell index under the cursor.

    Declaration
    public virtual int? GetCellIndexUnderCursor()
    Returns
    Type Description
    int?

    cell index if found and raycast hit the terrain, otherwise - false

    GetCellMineralIndex<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the MineralIndexMap value at the specified cell index from the specified CellMineralsLayer.

    Declaration
    public virtual uint? GetCellMineralIndex<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellMineralsLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    uint?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellMineralsLayer from

    TLayer

    type of CellMineralsLayer from the HexTerrainLayerGroup to get a cell value from

    GetCellObject<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the ObjectMap value at the specified cell index from the specified CellObjectLayer.

    Declaration
    public virtual int? GetCellObject<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellObjectLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    int?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellObjectLayer from

    TLayer

    type of CellObjectLayer from the HexTerrainLayerGroup to get a cell value from

    GetCellRegion<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the RegionMap value at the specified cell index from the specified CellRegionLayer.

    Declaration
    public virtual int? GetCellRegion<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellRegionLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    int?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellRegionLayer from

    TLayer

    type of CellRegionLayer from the HexTerrainLayerGroup to get a cell value from

    GetChunkMeshLayerVisibility<TLayerGroup, TLayer>(HexTerrainLayerReference)

    Tells if the specified chunk mesh layer is visible.

    Declaration
    public virtual bool? GetChunkMeshLayerVisibility<TLayerGroup, TLayer>(HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : VisualChunkMeshLayer
    Parameters
    Type Name Description
    HexTerrainLayerReference layerReference

    A reference to the terrain layer whose mesh layer visibility is to be determined.

    Returns
    Type Description
    bool?

    A Boolean value indicating whether the mesh layer is visible; true if visible, false if not visible, or null if the visibility state cannot be determined.

    Type Parameters
    Name Description
    TLayerGroup

    The type of the terrain layer group containing the mesh layer. Must implement HexTerrainLayerGroup and IComponentData.

    TLayer

    The type of the chunk mesh layer to check for visibility. Must inherit from ChunkMeshLayer.

    GetGeoPlastAmount<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the AmountMap value at the specified cell index from the specified GeoPlastLayer.

    Declaration
    public virtual float? GetGeoPlastAmount<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : GeoPlastLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    float?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the GeoPlastLayer from

    TLayer

    type of GeoPlastLayer from the HexTerrainLayerGroup to get a cell value from

    GetGeoPlastDensity<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the DensityMap value at the specified cell index from the specified GeoPlastLayer.

    Declaration
    public virtual float? GetGeoPlastDensity<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : GeoPlastLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    float?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the GeoPlastLayer from

    TLayer

    type of GeoPlastLayer from the HexTerrainLayerGroup to get a cell value from

    GetGeoPlastHeat<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the HeatMap value at the specified cell index from the specified MaterialGeoPlastLayer.

    Declaration
    public virtual float? GetGeoPlastHeat<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : MaterialGeoPlastLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    float?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the MaterialGeoPlastLayer from

    TLayer

    type of MaterialGeoPlastLayer from the HexTerrainLayerGroup to get a cell value from

    GetGeoPlastVolume<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the VolumeMap value at the specified cell index from the specified GeoPlastLayer.

    Declaration
    public virtual float? GetGeoPlastVolume<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : GeoPlastLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    float?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the GeoPlastLayer from

    TLayer

    type of GeoPlastLayer from the HexTerrainLayerGroup to get a cell value from

    GetHexTerrainPrefabConfigsBuffer<THexTerrainPrefabConfig>()

    Returns a list of available HexTerrainPrefabConfigs from the UserToolEntity (if any)

    Declaration
    public virtual DynamicBuffer<THexTerrainPrefabConfig> GetHexTerrainPrefabConfigsBuffer<THexTerrainPrefabConfig>() where THexTerrainPrefabConfig : unmanaged, IBufferElementData, IHexTerrainPrefabConfig
    Returns
    Type Description
    DynamicBuffer<THexTerrainPrefabConfig>
    Type Parameters
    Name Description
    THexTerrainPrefabConfig

    type of HexTerrainPrefabConfig you have

    GetHexTerrainPrefabConfigsList()

    Returns a list of available HexTerrainPrefabConfigs from the UserToolEntity (if any). This list can be sent to the UI to display available terrain prefabs for the user to select from.

    Declaration
    public virtual IList<IHexTerrainPrefabConfig> GetHexTerrainPrefabConfigsList()
    Returns
    Type Description
    IList<IHexTerrainPrefabConfig>

    collection of hex terrain prefab configs for user to select from

    GetIsResizableBrush()

    Returns true if the brush on TerrainEntity is resizable.

    Declaration
    public virtual bool GetIsResizableBrush()
    Returns
    Type Description
    bool

    is brush found and resizable

    GetIsTerrainVisible()

    Returns true if terrain is visible, false is invisible, null if no terrain with visibility foundHexTerrainVisibility.

    Declaration
    public bool? GetIsTerrainVisible()
    Returns
    Type Description
    bool?

    true if terrain is visible, false is invisible, null if no terrain with visibility found

    GetIsVisibleBrush()

    Returns true if the brush on TerrainEntity is visible.

    Declaration
    public virtual bool GetIsVisibleBrush()
    Returns
    Type Description
    bool

    true if brush is found and is visible, otherwise - false

    GetMineralsAmount<TLayerGroup, TLayer>(int, HexTerrainLayerReference)

    Returns the AmountMap value at the specified cell index from the specified CellMineralsLayer.

    Declaration
    public virtual float? GetMineralsAmount<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellMineralsLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to get a value from

    HexTerrainLayerReference layerReference

    reference to the layer to get a cell value from

    Returns
    Type Description
    float?

    value if found or null if not found

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellMineralsLayer from

    TLayer

    type of CellMineralsLayer from the HexTerrainLayerGroup to get a cell value from

    GetOrCreateUIScreen<TScreen>()

    Gets an existing screen of the specified type, or creates a new one if it doesn't exist.

    Declaration
    public virtual TScreen GetOrCreateUIScreen<TScreen>() where TScreen : UIScreen
    Returns
    Type Description
    TScreen

    screen instance

    Type Parameters
    Name Description
    TScreen

    type of the screen to get or create

    GetRaycastData()

    Returns the Raycast data from the TerrainEntity HexTerrainRaycastData. this data contains information about the raycast from mouse to terrain result.

    Declaration
    public virtual HexTerrainRaycastData? GetRaycastData()
    Returns
    Type Description
    HexTerrainRaycastData?

    raycast data from the TerrainEntity

    GetTerrainEntity()

    Returns the TerrainEntity this API is working with.

    Declaration
    public Entity GetTerrainEntity()
    Returns
    Type Description
    Entity

    terrain terrainEntity this API works with

    GetTerrainLayer<TDataLayer>()

    returns a data layer from the TerrainEntity TerrainEntity

    Declaration
    public virtual TDataLayer GetTerrainLayer<TDataLayer>() where TDataLayer : class
    Returns
    Type Description
    TDataLayer
    Type Parameters
    Name Description
    TDataLayer

    GetTerrainSettings()

    Returns a Terrain Settings if found.

    Declaration
    public virtual HexTerrainSettings? GetTerrainSettings()
    Returns
    Type Description
    HexTerrainSettings?

    terrain settings if found or null if not found

    GetUIScreen<TScreen>()

    Gets an existing screen of the specified type if found.

    Declaration
    public virtual TScreen GetUIScreen<TScreen>() where TScreen : UIScreen
    Returns
    Type Description
    TScreen
    Type Parameters
    Name Description
    TScreen

    type of the screen to get

    GetViewMode()

    Returns the view mode of the TerrainEntity HexTerrainViewMode.

    Declaration
    public virtual int GetViewMode()
    Returns
    Type Description
    int

    view mode if found, otherwise - false

    HideChunkMeshLayer<TLayerGroup, TLayer>(HexTerrainLayerReference)

    Hides the specified chunk mesh layer within the given terrain layer group.

    Declaration
    public virtual bool HideChunkMeshLayer<TLayerGroup, TLayer>(HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : VisualChunkMeshLayer
    Parameters
    Type Name Description
    HexTerrainLayerReference layerReference

    A reference to the terrain layer to be hidden. Cannot be null.

    Returns
    Type Description
    bool

    true if the chunk mesh layer was successfully hidden; otherwise, false.

    Type Parameters
    Name Description
    TLayerGroup

    The type of the terrain layer group containing the chunk mesh layer. Must implement HexTerrainLayerGroup and IComponentData.

    TLayer

    The type of the chunk mesh layer to hide. Must inherit from ChunkMeshLayer.

    Init(Entity, Entity, EntityManager, IUISystemAPI, IEnvironmentAPI)

    Initializes the HexTerrainAPI with the terrain terrainEntity, terrainEntity manager and UI system API.

    Declaration
    public virtual void Init(Entity userToolsEntity, Entity terrainEntity, EntityManager entityManager, IUISystemAPI uiSystemAPI, IEnvironmentAPI environmentAPI)
    Parameters
    Type Name Description
    Entity userToolsEntity
    Entity terrainEntity
    EntityManager entityManager
    IUISystemAPI uiSystemAPI
    IEnvironmentAPI environmentAPI

    IsLayerSupported<TDataLayer>()

    Checks if the data layer is supported by the terrain. Meaning if terrain has this data layer.

    Declaration
    public virtual bool IsLayerSupported<TDataLayer>() where TDataLayer : class
    Returns
    Type Description
    bool

    true if supports, otherwise - false

    Type Parameters
    Name Description
    TDataLayer

    type of the TerrainLayer to check

    LoadTerrain(string)

    Loads the TerrainEntity from a file.

    Declaration
    public virtual bool LoadTerrain(string filePath)
    Parameters
    Type Name Description
    string filePath

    file path to load a terrain from

    Returns
    Type Description
    bool

    true if loaded, otherwise - false

    ResizeTerrain(int2)

    Resizes the TerrainEntity TerrainSize.

    Declaration
    public virtual bool ResizeTerrain(int2 terrainSize)
    Parameters
    Type Name Description
    int2 terrainSize

    new terrain size

    Returns
    Type Description
    bool

    true if was resized, otherwise - false

    SaveTerrain(string)

    Saves the TerrainEntity to a file.

    Declaration
    public virtual bool SaveTerrain(string filePath)
    Parameters
    Type Name Description
    string filePath

    file path to save a terrain into

    Returns
    Type Description
    bool

    true if terrain has been saved, otherwise - false

    SetBrushColor(Color32)

    Sets the brush color on the TerrainEntity HexTerrainBrush.

    Declaration
    public virtual bool SetBrushColor(Color32 color)
    Parameters
    Type Name Description
    Color32 color

    new brush color

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    SetBrushOpacity(float)

    Sets the brush opacity on the TerrainEntity HexTerrainBrush.

    Declaration
    public virtual bool SetBrushOpacity(float opacity)
    Parameters
    Type Name Description
    float opacity

    new opacity value (0..1)

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    SetBrushSize(int)

    Sets the brush size on the TerrainEntity HexTerrainBrush.

    Declaration
    public virtual bool SetBrushSize(int brushSize)
    Parameters
    Type Name Description
    int brushSize

    new brush size

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    SetCellBiome<TLayerGroup, TLayer>(int, HexTerrainLayerReference, int)

    Sets the BiomeMap value at the specified cell index at the specified ChunkMeshLayer.

    Declaration
    public virtual bool SetCellBiome<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, int value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : ChunkMeshLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    int value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the ChunkMeshLayer from

    TLayer

    type of ChunkMeshLayer from the HexTerrainLayerGroup to set a cell value at

    SetCellEntity<TLayerGroup, TLayer>(int, HexTerrainLayerReference, int)

    Sets the EntityMap value at the specified cell index at the specified CellEntityLayer.

    Declaration
    public virtual bool SetCellEntity<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, int value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellEntityLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    int value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellEntityLayer from

    TLayer

    type of CellEntityLayer from the HexTerrainLayerGroup to set a cell value at

    SetCellHeight<TLayerGroup, TLayer>(int, HexTerrainLayerReference, float)

    Sets the HeightMap value at the specified cell index at the specified ChunkMeshLayer.

    Declaration
    public virtual bool SetCellHeight<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, float value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : ChunkMeshLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    float value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the ChunkMeshLayer from

    TLayer

    type of ChunkMeshLayer from the HexTerrainLayerGroup to set a cell value at

    SetCellMineralIndex<TLayerGroup, TLayer>(int, HexTerrainLayerReference, uint)

    Sets the MineralIndexMap value at the specified cell index at the specified CellMineralsLayer.

    Declaration
    public virtual bool SetCellMineralIndex<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, uint value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellMineralsLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    uint value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellMineralsLayer from

    TLayer

    type of CellMineralsLayer from the HexTerrainLayerGroup to set a cell value at

    SetCellObject<TLayerGroup, TLayer>(int, HexTerrainLayerReference, int)

    Sets the ObjectMap value at the specified cell index at the specified CellObjectLayer.

    Declaration
    public virtual bool SetCellObject<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, int value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellObjectLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    int value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellObjectLayer from

    TLayer

    type of CellObjectLayer from the HexTerrainLayerGroup to set a cell value at

    SetCellRegion<TLayerGroup, TLayer>(int, HexTerrainLayerReference, int)

    Sets the RegionMap value at the specified cell index at the specified CellRegionLayer.

    Declaration
    public virtual bool SetCellRegion<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, int value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellRegionLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    int value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellRegionLayer from

    TLayer

    type of CellRegionLayer from the HexTerrainLayerGroup to set a cell value at

    SetGeoPlastAmount<TLayerGroup, TLayer>(int, HexTerrainLayerReference, float)

    Sets the AmountMap value at the specified cell index at the specified GeoPlastLayer.

    Declaration
    public virtual bool SetGeoPlastAmount<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, float value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : GeoPlastLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    float value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the GeoPlastLayer from

    TLayer

    type of GeoPlastLayer from the HexTerrainLayerGroup to set a cell value at

    SetGeoPlastDensity<TLayerGroup, TLayer>(int, HexTerrainLayerReference, float)

    Sets the DensityMap value at the specified cell index at the specified GeoPlastLayer.

    Declaration
    public virtual bool SetGeoPlastDensity<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, float value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : GeoPlastLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    float value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the GeoPlastLayer from

    TLayer

    type of GeoPlastLayer from the HexTerrainLayerGroup to set a cell value at

    SetGeoPlastHeat<TLayerGroup, TLayer>(int, HexTerrainLayerReference, float)

    Sets the HeatMap value at the specified cell index at the specified MaterialGeoPlastLayer.

    Declaration
    public virtual bool SetGeoPlastHeat<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, float value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : MaterialGeoPlastLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    float value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the MaterialGeoPlastLayer from

    TLayer

    type of MaterialGeoPlastLayer from the HexTerrainLayerGroup to set a cell value at

    SetGeoPlastVolume<TLayerGroup, TLayer>(int, HexTerrainLayerReference, float)

    Sets the VolumeMap value at the specified cell index at the specified GeoPlastLayer.

    Declaration
    public virtual bool SetGeoPlastVolume<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, float value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : GeoPlastLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    float value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the GeoPlastLayer from

    TLayer

    type of GeoPlastLayer from the HexTerrainLayerGroup to set a cell value at

    SetIsResizableBrush(bool)

    Sets the IsResizable value of the brush on TerrainEntity HexTerrainBrush.

    Declaration
    public virtual bool SetIsResizableBrush(bool isResizableBrush)
    Parameters
    Type Name Description
    bool isResizableBrush

    new value for IsResizable

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    SetIsTerrainVisible(bool)

    Sets terrain visibility. HexTerrainVisibility Returns true if value was set

    Declaration
    public bool SetIsTerrainVisible(bool isVisible)
    Parameters
    Type Name Description
    bool isVisible

    New visibility value for terrain

    Returns
    Type Description
    bool

    True if value was set, otherwise - false

    SetIsVisibleBrush(bool)

    Sets the IsVisible value of the brush on TerrainEntity HexTerrainBrush.

    Declaration
    public virtual bool SetIsVisibleBrush(bool isVisibleBrush)
    Parameters
    Type Name Description
    bool isVisibleBrush

    new IsVisible value

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    SetMineralsAmount<TLayerGroup, TLayer>(int, HexTerrainLayerReference, float)

    Sets the AmountMap value at the specified cell index at the specified CellMineralsLayer.

    Declaration
    public virtual bool SetMineralsAmount<TLayerGroup, TLayer>(int cellIndex, HexTerrainLayerReference layerReference, float value) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : CellMineralsLayer
    Parameters
    Type Name Description
    int cellIndex

    cell index to set a value at

    HexTerrainLayerReference layerReference

    reference to the layer to set a cell value at

    float value

    value to set

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    Type Parameters
    Name Description
    TLayerGroup

    type of HexTerrainLayerGroup entity component to get the CellMineralsLayer from

    TLayer

    type of CellMineralsLayer from the HexTerrainLayerGroup to set a cell value at

    SetViewMode(SetViewModeRequest)

    Sets the view mode based on the parameters specified in the request.

    Declaration
    public virtual bool SetViewMode(SetViewModeRequest request)
    Parameters
    Type Name Description
    SetViewModeRequest request

    An object that specifies the view mode to set, either by index or by name. The request must indicate which method to use.

    Returns
    Type Description
    bool

    true if the view mode is successfully set; otherwise, false.

    Remarks

    If neither the view mode index nor the view mode name is specified in the request, the method returns false.

    SetViewMode(int)

    Sets the view mode on the TerrainEntity HexTerrainViewMode.

    Declaration
    public virtual bool SetViewMode(int viewMode)
    Parameters
    Type Name Description
    int viewMode

    new view mode

    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    SetViewMode(string)

    Sets the view mode on the TerrainEntity HexTerrainViewMode.

    Declaration
    public virtual bool SetViewMode(string viewModeName)
    Parameters
    Type Name Description
    string viewModeName
    Returns
    Type Description
    bool

    true if value has been set, otherwise - false

    ShowChunkMeshLayer<TLayerGroup, TLayer>(HexTerrainLayerReference)

    Declaration
    public virtual bool ShowChunkMeshLayer<TLayerGroup, TLayer>(HexTerrainLayerReference layerReference) where TLayerGroup : HexTerrainLayerGroup, IComponentData where TLayer : VisualChunkMeshLayer
    Parameters
    Type Name Description
    HexTerrainLayerReference layerReference
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    TLayerGroup
    TLayer

    ToggleIsTerrainVisible()

    Destroys the specified screen instance.

    Declaration
    public bool? ToggleIsTerrainVisible()
    Returns
    Type Description
    bool?

    true if the screen was destroyed successfully; otherwise, false

    Implements

    IHexTerrainAPI

    Extension Methods

    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    In this article
    Back to top Generated by DocFX