Class FlipOverModuleWrapper
MonoBehaviour wrapper for the FlipOver module.
Namespace: NWH.VehiclePhysics2.Modules.FlipOver
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
[DisallowMultipleComponent]
public class FlipOverModuleWrapper : ModuleWrapper
Remarks
Required component wrapper that allows the FlipOverModule to be attached to a GameObject with a VehicleController. The wrapper handles Unity's MonoBehaviour lifecycle and serialization while delegating the actual flip-over logic to the contained module.
Add this component to a vehicle GameObject through: - Unity Editor: Add Component > NWH > Vehicle Physics 2 > Modules > Flip Over Module - Script: gameObject.AddComponent<FlipOverModuleWrapper>() - Inspector: Via the VehicleController's Modules section
The module can be accessed at runtime through the module field for: - Dynamic configuration changes (activation mode, recovery type) - Querying flip state (flippedOver) - Adjusting timing and thresholds - Implementing custom UI prompts - Integrating with game systems (achievements, penalties, etc.)
Example runtime usage:
var flipOverWrapper = vehicle.GetComponent<FlipOverModuleWrapper>();
if (flipOverWrapper.module.flippedOver)
{
// Show UI prompt
uiController.ShowMessage("Press T to flip vehicle");
}
Fields
module
The FlipOverModule instance managed by this wrapper.
Declaration
public FlipOverModule module
Field Value
| Type | Description |
|---|---|
| FlipOverModule |
Remarks
Access this field to configure flip-over settings at runtime or query the current flip state. All module settings are serialized and can be adjusted in the Unity Inspector or via script.
Methods
GetModule()
Returns the contained FlipOverModule as a VehicleComponent.
Declaration
public override VehicleComponent GetModule()
Returns
| Type | Description |
|---|---|
| VehicleComponent | The FlipOverModule instance cast to VehicleComponent. |
Overrides
SetModule(VehicleComponent)
Sets the contained module from a VehicleComponent reference.
Declaration
public override void SetModule(VehicleComponent module)
Parameters
| Type | Name | Description |
|---|---|---|
| VehicleComponent | module | The VehicleComponent to set, must be a FlipOverModule instance. |