Class UniversalViewModeConfigAsset
Implements
Inherited Members
Namespace: Fwt.HexTerrains.ViewModes.Data
Assembly: fwt.hexterrains.dll
Syntax
[CreateAssetMenu(menuName = "Fwt/HexTerrains/View Modes/Universal ViewMode Config", fileName = "UniversalViewModeConfig")]
public class UniversalViewModeConfigAsset : ViewModeConfigAssetBase, IViewModeConfig
Fields
ViewModeItems
Declaration
public List<UniversalViewModeConfigAsset.UniversalViewModeItemConfig> ViewModeItems
Field Value
| Type | Description |
|---|---|
| List<UniversalViewModeConfigAsset.UniversalViewModeItemConfig> |
Methods
GetColorMap(UniversalViewModeItemConfig, EntityManager, Entity)
Declaration
protected virtual CellColorsDataLayer GetColorMap(UniversalViewModeConfigAsset.UniversalViewModeItemConfig itemConfig, EntityManager entityManager, Entity terrainEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| UniversalViewModeConfigAsset.UniversalViewModeItemConfig | itemConfig | |
| EntityManager | entityManager | |
| Entity | terrainEntity |
Returns
| Type | Description |
|---|---|
| CellColorsDataLayer |
GetColorMapTextures(EntityManager, Entity)
Retrieves the collection of color map textures available for the specified terrain entity.
Declaration
public override IList<Texture2D> GetColorMapTextures(EntityManager entityManager, Entity terrainEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityManager | entityManager | The entity manager used to access and query entities and their components. |
| Entity | terrainEntity | The entity representing the terrain for which to retrieve color map textures. |
Returns
| Type | Description |
|---|---|
| IList<Texture2D> | A list of UnityEngine.Texture2D objects representing the color map textures for the specified terrain entity. The list is empty if no color map textures are found. |
Overrides
IsValid(UniversalViewModeItemConfig, EntityManager, Entity)
Declaration
protected virtual bool IsValid(UniversalViewModeConfigAsset.UniversalViewModeItemConfig item, EntityManager entityManager, Entity terrainEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| UniversalViewModeConfigAsset.UniversalViewModeItemConfig | item | |
| EntityManager | entityManager | |
| Entity | terrainEntity |
Returns
| Type | Description |
|---|---|
| bool |
UpdateColorMap(EntityManager, Entity, bool)
Updates the color map textures associated with the specified terrain entity in the given entity manager. This method can be used to refresh or modify the color map based on the current view mode state.
Declaration
public override bool UpdateColorMap(EntityManager entityManager, Entity terrainEntity, bool isViewModeDirty)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityManager | entityManager | The entity manager that manages the entities and their components. Must not be null. |
| Entity | terrainEntity | The terrain entity whose color map textures are to be updated. |
| bool | isViewModeDirty | Indicates whether the view mode has changed and requires the color map to be refreshed. If true, the color map will be updated accordingly. |
Returns
| Type | Description |
|---|---|
| bool | true if the color map was updated; otherwise, false. Returns true if any data was changed, so the according logic can be applied after |