Struct SetViewModeRequest
Request struct used to set the view mode of a terrain entity, allowing specification by either index or name. This struct can be used to request a change in the view mode of a terrain, providing flexibility in how the desired view mode is identified.
Inherited Members
Namespace: Fwt.HexTerrains.ViewModes.Data
Assembly: fwt.hexterrains.dll
Syntax
[Serializable]
public struct SetViewModeRequest
Fields
IsSetByViewModeIndex
If true, the view mode will be set based on the provided index ViewModeIndex.
Declaration
public bool IsSetByViewModeIndex
Field Value
| Type | Description |
|---|---|
| bool |
IsSetByViewModeName
If true, the view mode will be set based on the provided name ViewModeName.
Declaration
public bool IsSetByViewModeName
Field Value
| Type | Description |
|---|---|
| bool |
ViewModeIndex
If IsSetByViewModeIndex is true, this index will be used to set the view mode. The index corresponds to the position of the view mode in a list of available view modes in a ViewMode config attached to terrain entity ViewModeConfigsComponent.
Declaration
public int ViewModeIndex
Field Value
| Type | Description |
|---|---|
| int |
ViewModeName
If IsSetByViewModeName is true, this name will be used to set the view mode. The name corresponds to the name of the view mode in a list of available view modes in a ViewMode config attached to terrain entity ViewModeConfigsComponent.
Declaration
public string ViewModeName
Field Value
| Type | Description |
|---|---|
| string |
Methods
ByViewModeIndex(int)
Creates a new request to set the view mode using the specified view mode index.
Declaration
public static SetViewModeRequest ByViewModeIndex(int viewModeIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | viewModeIndex | The zero-based index of the desired view mode. Must correspond to a valid view mode available in the configuration. |
Returns
| Type | Description |
|---|---|
| SetViewModeRequest | A SetViewModeRequest instance configured to set the view mode by index, with the specified view mode index applied. |
Remarks
Use this method when you want to select a view mode by its index rather than by name. This is useful in scenarios where view modes are managed or referenced by their position in a collection.
ByViewModeName(string)
Creates a new request to set the view mode using the specified view mode name.
Declaration
public static SetViewModeRequest ByViewModeName(string viewModeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | viewModeName | The name of the view mode to set. This parameter cannot be null or empty. |
Returns
| Type | Description |
|---|---|
| SetViewModeRequest | A SetViewModeRequest object configured to set the view mode by name. |
Remarks
Use this method when you need to specify the view mode by its user-friendly name rather than by index.