NWH Aerodynamics
Search Results for

    Show / Hide Table of Contents

    Class LightSource

    Individual light source component that can be either a Unity Light or an emissive mesh. Multiple LightSources combine to form a complete AircraftLight assembly.

    Inheritance
    object
    LightSource
    Namespace: NWH.Aerodynamics.AircraftController.Effects.Lights
    Assembly: NWH.Aerodynamics.dll
    Syntax
    [Serializable]
    public class LightSource
    Remarks

    Supports two types: Unity Light components (Spot/Point/Directional) for actual illumination, and emissive meshes using Standard shader for visual glow effects like lens appearances.

    Fields

    | Edit this page View Source

    emissionColor

    Emission color used for mesh-type light sources. Supports HDR for bloom effects. Applied to the material's emission channel when the light is on.

    Declaration
    [ColorUsage(true, true)]
    [Tooltip("Color of the emitted light.")]
    public Color emissionColor
    Field Value
    Type Description
    Color
    | Edit this page View Source

    light

    Unity Light component used when type is set to Light. Can be any light type: Spot, Point, Directional, or Area.

    Declaration
    [Tooltip("Light (point/spot/directional/etc.) representing the vehicle light. Will only be used if light type is set to\r\nLight.")]
    public Light light
    Field Value
    Type Description
    Light
    | Edit this page View Source

    meshRenderer

    Mesh renderer used when type is set to Mesh. Must use Standard shader or compatible material. Emission keyword will be toggled on/off to create glow effect.

    Declaration
    [Tooltip("Mesh renderer using standard shader. Emission on the material will be turned on or off depending on light state.")]
    public MeshRenderer meshRenderer
    Field Value
    Type Description
    MeshRenderer
    | Edit this page View Source

    onLightTurnedOff

    Event invoked when this light source is deactivated.

    Declaration
    [NonSerialized]
    [Tooltip("Called when the light is turned off.")]
    public UnityEvent onLightTurnedOff
    Field Value
    Type Description
    UnityEvent
    | Edit this page View Source

    onLightTurnedOn

    Event invoked when this light source is activated.

    Declaration
    [NonSerialized]
    [Tooltip("Called when the light is turned on.")]
    public UnityEvent onLightTurnedOn
    Field Value
    Type Description
    UnityEvent
    | Edit this page View Source

    rendererMaterialIndex

    Material array index to modify when using mesh-type light source. Use if the mesh has multiple materials and the emissive one is not at index 0.

    Declaration
    [Tooltip("If your mesh has more than one material set this number to the index of required material.")]
    public int rendererMaterialIndex
    Field Value
    Type Description
    int
    | Edit this page View Source

    type

    Specifies whether this source uses a Unity Light or emissive mesh.

    Declaration
    [Tooltip("Type of the light.")]
    public LightSource.LightType type
    Field Value
    Type Description
    LightSource.LightType

    Properties

    | Edit this page View Source

    IsOn

    Current activation state of this light source.

    Declaration
    public bool IsOn { get; }
    Property Value
    Type Description
    bool

    Methods

    | Edit this page View Source

    TurnOff()

    Declaration
    public virtual void TurnOff()
    | Edit this page View Source

    TurnOn()

    Declaration
    public virtual void TurnOn()
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics