Class MinimapScreenBase
Base class for the minimap UI screen. Inherit from this class to create a new minimap screen (optional). In reality you have to implement IMinimapScreen interface to allow HexTerrains to interact with your screen.
Inheritance
Inherited Members
Namespace: Fwt.HexTerrains.UI
Assembly: fwt.hexterrains.dll
Syntax
public abstract class MinimapScreenBase : UIScreen<MinimapScreenDataSource>, IViewDataReceiver<MinimapScreenDataSource>, IMinimapScreen
Fields
ViewMode
Current view mode of the minimap.
Declaration
public int ViewMode
Field Value
| Type | Description |
|---|---|
| int |
ViewModes
Array of settigs for each view mode. Index in this list = view mode.
Declaration
public List<MinimapScreenBase.ViewModeSettings> ViewModes
Field Value
| Type | Description |
|---|---|
| List<MinimapScreenBase.ViewModeSettings> |
_entityManager
Cached EntityManager of the World with terrains.
Declaration
protected EntityManager _entityManager
Field Value
| Type | Description |
|---|---|
| EntityManager |
_terrainEntity
Terrain entity this minimap screen shows
Declaration
protected Entity _terrainEntity
Field Value
| Type | Description |
|---|---|
| Entity |
_world
Cached Entity World with terrains.
Declaration
protected World _world
Field Value
| Type | Description |
|---|---|
| World |
Properties
TerrainEntity
Terrain entity this minimap screen shows
Declaration
public virtual Entity TerrainEntity { get; protected set; }
Property Value
| Type | Description |
|---|---|
| Entity |
TexturesVersion
Cached viewModeVersion of the color textures. If it is different from the viewModeVersion of Color Textures data, the screen will be updated with a new data.
Declaration
public long TexturesVersion { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
ViewModeVersion
Cached viewModeVersion of the view mode. If it is different from the viewModeVersion of View Mode data, the screen will be updated with a new data.
Declaration
public long ViewModeVersion { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
Methods
OnMinimapClick(float2)
Called from UI when user clicks on the minimap. (Makes a camera to center at clicked position).
Declaration
public virtual void OnMinimapClick(float2 normalizedPos)
Parameters
| Type | Name | Description |
|---|---|---|
| float2 | normalizedPos | Click position in range x 0..1 and y 0..1 where 1 is the full width/height of the terrain |
OnViewModeChanged()
Called when the view mode is changed.
Declaration
protected virtual void OnViewModeChanged()
SetCameraNormalizedPosition(float2)
Sets the camera normalized position for the minimap. This is called from system so UI screen can update its data. Normalized position is a position in range x 0..1 and y 0..1 where 1 is the full width/height of the terrain in meters.
Declaration
public virtual void SetCameraNormalizedPosition(float2 normalizedCameraPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| float2 | normalizedCameraPosition | Position of the camera relative to the map in range 0..1 where 1 is a full width/height of the terrain in meters |
SetColorTextures(NativeArray<ColorMapTexture>, long)
Set the color textures for the minimap. Called from system so UI screen can update its data.
Declaration
public virtual void SetColorTextures(NativeArray<ColorMapTexture> textures, long texturesVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeArray<ColorMapTexture> | textures | new set of textures |
| long | texturesVersion | viewModeVersion of textures provided |
SetTerrainEntity(Entity)
Sets an entity of terrain that will be displayed on the minimap.
Declaration
public virtual void SetTerrainEntity(Entity terrainEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| Entity | terrainEntity | Entity of terrain to be shown on minimap |
SetViewMode(int, long)
Set the view mode for the minimap. Called from system so UI screen can update its data.
Declaration
public virtual void SetViewMode(int viewMode, long viewModeVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| int | viewMode | |
| long | viewModeVersion |
SetViewModeOnTerrain(int)
Set the view mode for the minimap. Called from system so UI screen can update its data.
Declaration
public virtual void SetViewModeOnTerrain(int newViewMode)
Parameters
| Type | Name | Description |
|---|---|---|
| int | newViewMode |
Start()
Declaration
protected override void Start()