Class StateDefinition
Stores the runtime state configuration for a single VehicleComponent. Determines whether a component is enabled and at which LOD level it should operate.
Namespace: NWH.VehiclePhysics2
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class StateDefinition
Constructors
StateDefinition()
Creates a new StateDefinition with default values.
Declaration
public StateDefinition()
StateDefinition(string, bool, int)
Creates a new StateDefinition with the specified configuration.
Declaration
public StateDefinition(string fullName, bool isEnabled, int lod)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fullName | The fully qualified type name of the VehicleComponent. |
| bool | isEnabled | Whether the component should be enabled by default. |
| int | lod | The LOD level for this component. Use -1 to disable LOD for this component. |
Fields
fullName
Fully qualified type name of the VehicleComponent this state definition applies to. Used to match the definition with the actual component instance at runtime. Example: "NWH.VehiclePhysics2.Sound.SoundManager"
Declaration
[Tooltip("Full type name of the VehicleComponent.")]
public string fullName
Field Value
| Type | Description |
|---|---|
| string |
initialized
Indicates whether the component has been initialized. Set to true after the component's Initialize() method has been called successfully.
Declaration
[Tooltip("Has the component been initialized?")]
public bool initialized
Field Value
| Type | Description |
|---|---|
| bool |
isEnabled
Determines if this component should be enabled when the VehicleController is enabled. Disabled components do not update and do not consume processing time. Can be toggled at runtime to enable or disable specific vehicle features.
Declaration
[Tooltip("When VehicleController is enabled, should this component be enabled too?")]
public bool isEnabled
Field Value
| Type | Description |
|---|---|
| bool |
lodIndex
The LOD (Level of Detail) level at which this component operates. Higher values indicate lower detail levels for performance optimization. A value of -1 means LOD is disabled for this component and it will always run at full detail when enabled.
Declaration
[Tooltip("Active LOD. -1 for disabled LODs.")]
public int lodIndex
Field Value
| Type | Description |
|---|---|
| int |