NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Class TrailerHitchModuleWrapper

    MonoBehaviour wrapper for the TrailerHitchModule.

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

    Goes on a GameObject with a VehicleController. Awake builds the SphereCollider trigger that finds nearby trailers on a dedicated child of the attachment point.

    Fields

    module

    The wrapped TrailerHitchModule instance.

    Declaration
    public TrailerHitchModule module
    Field Value
    Type Description
    TrailerHitchModule

    Methods

    GetModule()

    Gets the wrapped module as a VehicleComponent.

    Declaration
    public override VehicleComponent GetModule()
    Returns
    Type Description
    VehicleComponent

    The TrailerHitchModule instance cast to VehicleComponent

    Overrides
    ModuleWrapper.GetModule()

    OnTriggerEnter(Collider)

    Binary-compatibility callback retained for integrations compiled against earlier releases.

    Declaration
    [Obsolete("Trailer trigger contacts are forwarded by the package-owned hitch relay. Remove manual OnTriggerEnter calls.")]
    public void OnTriggerEnter(Collider other)
    Parameters
    Type Name Description
    Collider other
    Remarks

    This is intentionally a no-op. Runtime contacts are handled only by the package-owned child relay, preventing unrelated compound-collider contacts from reaching the hitch.

    OnTriggerExit(Collider)

    Binary-compatibility callback retained for integrations compiled against earlier releases.

    Declaration
    [Obsolete("Trailer trigger contacts are forwarded by the package-owned hitch relay. Remove manual OnTriggerExit calls.")]
    public void OnTriggerExit(Collider other)
    Parameters
    Type Name Description
    Collider other
    Remarks

    This is intentionally a no-op. Runtime contacts are handled only by the package-owned child relay, preventing unrelated compound-collider contacts from reaching the hitch.

    OnTriggerStay(Collider)

    Binary-compatibility callback retained for integrations compiled against earlier releases.

    Declaration
    [Obsolete("Trailer trigger contacts are forwarded by the package-owned hitch relay. Remove manual OnTriggerStay calls.")]
    public void OnTriggerStay(Collider other)
    Parameters
    Type Name Description
    Collider other
    Remarks

    This is intentionally a no-op. The child relay uses Enter/Exit only and therefore avoids recurring per-fixed-step managed trigger work.

    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 TrailerHitchModule instance

    Overrides
    ModuleWrapper.SetModule(VehicleComponent)
    Remarks

    Rebinds the attachment trigger to the new module. Only touches the trigger in play mode.

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