Class HexTerrainCursorViewBase
Base class for the HexTerrainCursorView. This is a game object that is used to visualize the brush on the terrain. Expected to use a Projector to project the brush material on the terrain.
Inheritance
Inherited Members
Namespace: Fwt.HexTerrains.Brushes
Assembly: fwt.hexterrains.dll
Syntax
public abstract class HexTerrainCursorViewBase : MonoBehaviour
Fields
BaseRotationAngle
Base rotation angle of the brush in degrees (initial rotation of the brush). If brush size is more than 1, the brush is rotated by 30 degrees (for visual purposes). Because the hexagon that covers an area of hexagons is rotated by 30 degrees relative to the single hexagon.
Declaration
public float BaseRotationAngle
Field Value
| Type | Description |
|---|---|
| float |
BrushMaterialColorPropertyName
Declaration
[SerializeField]
protected string BrushMaterialColorPropertyName
Field Value
| Type | Description |
|---|---|
| string |
SizeMultiplier
Size of the brush will be multiplied by this value
Declaration
public int SizeMultiplier
Field Value
| Type | Description |
|---|---|
| int |
_brushColor
The brush color.
Declaration
[SerializeField]
protected Color32 _brushColor
Field Value
| Type | Description |
|---|---|
| Color32 |
_brushOpacity
The brush opacity (0-1).
Declaration
[SerializeField]
protected int _brushOpacity
Field Value
| Type | Description |
|---|---|
| int |
_brushSize
The brush size in cells.
Declaration
[SerializeField]
protected int _brushSize
Field Value
| Type | Description |
|---|---|
| int |
_isResizable
The brush is resizable if this value is true.
Declaration
[SerializeField]
protected bool _isResizable
Field Value
| Type | Description |
|---|---|
| bool |
_terrainSettings
Settings of the terrain this brush is painted on.
Declaration
[SerializeField]
protected HexTerrainSettings _terrainSettings
Field Value
| Type | Description |
|---|---|
| HexTerrainSettings |
Methods
GetBrushColor()
Returns the brush color.
Declaration
public virtual Color32 GetBrushColor()
Returns
| Type | Description |
|---|---|
| Color32 | Color of the brush |
GetBrushMaterial()
Returns the brush material (used to set color and opacity).
Declaration
public virtual Material GetBrushMaterial()
Returns
| Type | Description |
|---|---|
| Material | Material from the brush |
GetBrushOpacity()
Returns the brush opacity (0-1).
Declaration
public virtual float GetBrushOpacity()
Returns
| Type | Description |
|---|---|
| float | Opacity of the brush (0-1) |
GetBrushSize()
Returns the size of the brush in cells.
Declaration
public virtual int GetBrushSize()
Returns
| Type | Description |
|---|---|
| int |
GetIsResizable()
Returns true if the brush is resizable, otherwise - false
Declaration
public virtual bool GetIsResizable()
Returns
| Type | Description |
|---|---|
| bool | True if brush is resizable, othewise - false |
SetBrushColor(Color32)
Sets the brush color.
Declaration
public virtual bool SetBrushColor(Color32 color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color32 | color |
Returns
| Type | Description |
|---|---|
| bool | true if value wa set, otherwise - false |
SetBrushMaterial(Material)
Returns true if value has been changed
Declaration
public virtual bool SetBrushMaterial(Material material)
Parameters
| Type | Name | Description |
|---|---|---|
| Material | material |
Returns
| Type | Description |
|---|---|
| bool |
SetBrushOpacity(float)
Sets the brush opacity (0-1).
Declaration
public virtual bool SetBrushOpacity(float opacity)
Parameters
| Type | Name | Description |
|---|---|---|
| float | opacity |
Returns
| Type | Description |
|---|---|
| bool | true if value wa set, otherwise - false |
SetBrushSize(int)
Returns true if value has been changed
Declaration
public virtual bool SetBrushSize(int brushSize)
Parameters
| Type | Name | Description |
|---|---|---|
| int | brushSize |
Returns
| Type | Description |
|---|---|
| bool |
SetIsResizable(bool)
Sets the brush resizable property.
Declaration
public virtual bool SetIsResizable(bool isResizable)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isResizable | new value for IsResizable brush |
Returns
| Type | Description |
|---|---|
| bool | true if data was set |
SetTerrainSettings(HexTerrainSettings)
Returns the settings of the terrain this brush is painted on.
Declaration
public virtual bool SetTerrainSettings(HexTerrainSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| HexTerrainSettings | settings |
Returns
| Type | Description |
|---|---|
| bool | true if value wa set, otherwise - false |