NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    ModuleWrapper
    TrailerModuleWrapper
    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
    ModuleWrapper.GetModule()

    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
    ModuleWrapper.SetModule(VehicleComponent)
    Remarks

    In play mode the old coupler trigger is torn down and rebuilt against the new module.

    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics