Class SetChunkMeshVisibilityUserToolState
Inheritance
Implements
Inherited Members
Namespace: Fwt.HexTerrains.UserTools.SM.States
Assembly: fwt.hexterrains.dll
Syntax
public class SetChunkMeshVisibilityUserToolState : BrushUserToolState<ChunkMeshLayerGroup, UserToolSettingsDataSource, UniversalToolSettingsScreen, VisualChunkMeshLayer>, ISmState
Constructors
SetChunkMeshVisibilityUserToolState(ISmState)
Declaration
public SetChunkMeshVisibilityUserToolState(ISmState parent)
Parameters
| Type | Name | Description |
|---|---|---|
| ISmState | parent |
Properties
IsVisible
Declaration
public bool IsVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
TerrainLayerIndex
If IsGetLayerByIndex is true, this index is used to get terrain layer from terrain layers list."/>
Declaration
public override int TerrainLayerIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
UserToolType
Type identifier for the user tool. Allows state machine to change states based on tool type instead of state index.
Declaration
public override int UserToolType { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Methods
ApplyBrush(int, int2, int, ChunkMeshLayerGroup, int)
Applies brush to the brushView. Returns true if changes were applied
Declaration
public override bool ApplyBrush(int brushMode, int2 cellCoord, int cellIndex, ChunkMeshLayerGroup brushTarget, int mouseButton)
Parameters
| Type | Name | Description |
|---|---|---|
| int | brushMode | |
| int2 | cellCoord | |
| int | cellIndex | |
| ChunkMeshLayerGroup | brushTarget | |
| int | mouseButton |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
Init(UserToolStateSettings)
Initializes the tool state with the specified settings.
Declaration
public override void Init(UserToolStateSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| UserToolStateSettings | settings | The settings to apply to the tool state. Cannot be null. |
Overrides
InitDefaultSettings()
Initializes the default settings for the current instance. This method is intended to be overridden in derived classes to configure initial values or options as needed.
Declaration
protected override void InitDefaultSettings()
Overrides
Remarks
Override this method in a subclass to provide custom initialization logic for default settings. The base implementation does not perform any actions.
LoadSettings()
Loads configuration settings for the current instance. Derived classes override this method to implement custom settings initialization.
Declaration
protected override void LoadSettings()
Overrides
Remarks
Override this method in a subclass to provide specific logic for loading or initializing settings. This method is called during the setup or initialization phase and does not perform any actions in the base implementation.
OnIsVisibleChanged()
Declaration
protected virtual void OnIsVisibleChanged()
OnTerrainLayerChanged()
Invoked when the terrain layer changes to update the view mode accordingly.
Declaration
protected override void OnTerrainLayerChanged()
Overrides
Remarks
Derived classes can override this method to implement custom behavior when the terrain layer changes. This method is called automatically and should not be invoked directly.
PrepareToRun()
Performs any necessary initialization or setup required before executing the main operation. Called by state machine once when state becomes active. If state is disabled and then enabled again, this method will be called again.
Declaration
public override void PrepareToRun()
Overrides
Remarks
Override this method to implement preparation logic specific to the derived class. This method should be called prior to running the core functionality to ensure all prerequisites are met.
SaveSettings()
Saves the current settings to the underlying storage or configuration source.
Declaration
protected override void SaveSettings()
Overrides
Remarks
Override this method in a derived class to implement custom logic for persisting settings. This method does not perform any action in the base implementation.