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.
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 SourceemissionColor
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 |
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 |
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 |
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 |
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 |
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 |
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 SourceIsOn
Current activation state of this light source.
Declaration
public bool IsOn { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
| Edit this page View SourceTurnOff()
Declaration
public virtual void TurnOff()
TurnOn()
Declaration
public virtual void TurnOn()