Class ModuleTemplateWrapper
MonoBehaviour wrapper for the ModuleTemplate module. Enables the ModuleTemplate to be attached as a component and serialized in the Unity Inspector.
Namespace: NWH.VehiclePhysics2.Modules.ModuleTemplate
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class ModuleTemplateWrapper : ModuleWrapper
Remarks
When creating a custom module wrapper:
- Create a public field of your module type (serialized for inspector editing)
- Implement GetModule() to return your module instance
- Implement SetModule() to cast and assign the module
- Name the wrapper class as {ModuleName}Wrapper for consistency
- Add the wrapper component to a GameObject with a VehicleController
Fields
module
The ModuleTemplate instance managed by this wrapper. Serialized to allow configuration in the Unity Inspector.
Declaration
public ModuleTemplate module
Field Value
| Type | Description |
|---|---|
| ModuleTemplate |
Methods
GetModule()
Returns the ModuleTemplate instance managed by this wrapper.
Declaration
public override VehicleComponent GetModule()
Returns
| Type | Description |
|---|---|
| VehicleComponent | The ModuleTemplate instance as a VehicleComponent. |
Overrides
SetModule(VehicleComponent)
Sets the ModuleTemplate instance to be managed by this wrapper.
Declaration
public override void SetModule(VehicleComponent module)
Parameters
| Type | Name | Description |
|---|---|---|
| VehicleComponent | module | The VehicleComponent to assign, which will be cast to ModuleTemplate. |