Struct InitColorMapCellValueDataLayerArgs<TValue>
Provides configuration parameters for initializing a color map cell value data layer, including value ranges, fill options, randomization, source texture settings, and color mapping details.
Inherited Members
Namespace: Fwt.HexTerrains.Data
Assembly: fwt.hexterrains.dll
Syntax
[Serializable]
public struct InitColorMapCellValueDataLayerArgs<TValue> : IInitColorMapCellValueDataLayerArgs<TValue>, IInitCellValueDataLayerArgs<TValue> where TValue : unmanaged
Type Parameters
| Name | Description |
|---|---|
| TValue | The type of cell value to be used in the data layer. Must be an unmanaged type. |
Remarks
Use this structure to specify how cell values should be initialized in a color map data layer. Options include filling with a constant value, randomizing within a specified range, or applying values from a source texture. The color mapping can be customized using a palette or automatic mode. Only one initialization method should typically be enabled at a time to avoid conflicts.
Properties
AutoColorMapMode
Determines the mode used to automatically generate the color map.
Declaration
public AutoColorMapMode AutoColorMapMode { get; set; }
Property Value
| Type | Description |
|---|---|
| AutoColorMapMode |
ColorPalette
Gets or sets the collection of colors used in the palette to calculate the color map.
Declaration
public List<Color32> ColorPalette { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Color32> |
DefaultColor
This color is used to paint cells if the cell value is out of the range of the color palette.
Declaration
public Color32 DefaultColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color32 |
DefaultValue
When the layer is resized, this value is used to fill any new cells that are added to the layer. This allows for consistent initialization of new cells when the layer's dimensions change.
Declaration
public TValue DefaultValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TValue |
FillValue
Value to use when filling cells with random values IsFillWithValue
Declaration
public TValue FillValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TValue |
IsApplySourceTexture
If true, cell values will be derived from the provided source texture upon initialization.
Declaration
public bool IsApplySourceTexture { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsColorMapEnabled
If disabled, color map calculations don't run.
Declaration
public bool IsColorMapEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsFillWithRandomValues
If true, all cells will be filled with random values between RandomMinValue and RandomMaxValue upon initialization.
Declaration
public bool IsFillWithRandomValues { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsFillWithValue
If true, all cells will be filled with the specified FillValue upon initialization.
Declaration
public bool IsFillWithValue { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
MaxValue
Maximum value for the cell values in the data layer. Used for some calculations like cell color if AutoColorMapMode is GradientThroughPalette. Does not restrict the actual value in the cell.
Declaration
public TValue MaxValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TValue |
MinValue
Minimum value for the cell values in the data layer. Used for some calculations like cell color if AutoColorMapMode is GradientThroughPalette. Does not restrict the actual value in the cell.
Declaration
public TValue MinValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TValue |
RandomMaxValue
Maximum value for random value generation when IsFillWithRandomValues is true.
Declaration
public TValue RandomMaxValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TValue |
RandomMinValue
Minimum value for random value generation when IsFillWithRandomValues is true.
Declaration
public TValue RandomMinValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TValue |
SourceTexture
Texture used to source cell values when IsApplySourceTexture is true.
Declaration
public Texture2D SourceTexture { get; set; }
Property Value
| Type | Description |
|---|---|
| Texture2D |
SourceTextureValueOffset
If IsApplySourceTexture is true, this offset is added to the sampled texture value before setting to cell.
Declaration
public float SourceTextureValueOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
SourceTextureValueScale
If IsApplySourceTexture is true, the sampled texture value is multiplied by this scale before setting to cell.
Declaration
public float SourceTextureValueScale { get; set; }
Property Value
| Type | Description |
|---|---|
| float |