Class TrailerModuleWrapper
MonoBehaviour wrapper for the TrailerModule. Goes on a GameObject that has a VehicleController, and owns the SphereCollider trigger it builds at the attachment point in Awake(); TrailerHitchModule detects a coupling through that trigger.
Namespace: NWH.VehiclePhysics2.Modules.Trailer
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
[DisallowMultipleComponent]
public class TrailerModuleWrapper : ModuleWrapper
Fields
module
The wrapped TrailerModule instance. Holds the trailer config and attachment state.
Declaration
public TrailerModule module
Field Value
| Type | Description |
|---|---|
| TrailerModule |
Methods
GetModule()
Gets the wrapped module as a VehicleComponent.
Declaration
public override VehicleComponent GetModule()
Returns
| Type | Description |
|---|---|
| VehicleComponent | The TrailerModule instance cast to VehicleComponent |
Overrides
OnDrawGizmos()
Marks the trailer attachment point in the Scene view with a sphere and a label.
Declaration
public void OnDrawGizmos()
SetModule(VehicleComponent)
Sets the wrapped module from a VehicleComponent reference.
Declaration
public override void SetModule(VehicleComponent module)
Parameters
| Type | Name | Description |
|---|---|---|
| VehicleComponent | module | The VehicleComponent to wrap, must be a TrailerModule instance |
Overrides
Remarks
In play mode the old coupler trigger is torn down and rebuilt against the new module.