NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Class ModuleTemplateWrapper

    MonoBehaviour wrapper for the ModuleTemplate module. Enables the ModuleTemplate to be attached as a component and serialized in the Unity Inspector.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    ModuleWrapper
    ModuleTemplateWrapper
    Namespace: NWH.VehiclePhysics2.Modules.ModuleTemplate
    Assembly: NWH.VehiclePhysics2.dll
    Syntax
    [Serializable]
    public class ModuleTemplateWrapper : ModuleWrapper
    Remarks

    When creating a custom module wrapper:

    1. Create a public field of your module type (serialized for inspector editing)
    2. Implement GetModule() to return your module instance
    3. Implement SetModule() to cast and assign the module
    4. Name the wrapper class as {ModuleName}Wrapper for consistency
    5. 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
    ModuleWrapper.GetModule()

    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.

    Overrides
    ModuleWrapper.SetModule(VehicleComponent)
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics