Directiona light component

DirectionalLight

2024.1.3

yisky

Hierarchy (view full)

Constructors

Properties

_awoken: boolean = false
_enabled: boolean = false
entity: Entity
userData: {
    [key: string]: any;
}

Component user data

Component

Accessors

  • set color(value): void
  • Set color

    Parameters

    • value: ColorRepresentation

    Returns void

    DirectionalLight

  • set direction(value): void
  • Set local direction

    Parameters

    • value: Vector3

    Returns void

    DirectionalLight

  • get enabled(): boolean
  • Indicates whether the component is enabled.

    Returns boolean

    Component

  • set enabled(value): void
  • Set whether the component is enabled.

    Parameters

    • value: boolean

    Returns void

    Component

  • set intensity(value): void
  • Set intensity

    Parameters

    • value: number

    Returns void

    DirectionalLight

  • get light(): DirectionalLight
  • Get Three.js DirectionalLight

    Returns DirectionalLight

    DirectionalLight

  • set position(value): void
  • Set local position

    Parameters

    • value: Vector3

    Returns void

    DirectionalLight

  • get scene(): Scene
  • Scene own the component

    Returns Scene

    Component

  • set target(value): void
  • Set local target position

    Parameters

    • value: Vector3

    Returns void

    DirectionalLight

Methods

  • Protected

    Awake component callback

    Returns void

    Component

  • Protected

    Destroy callback

    Returns void

    DirectionalLight

  • Protected

    Disable callback

    Returns void

    DirectionalLight

  • Protected

    Enable callback

    Returns void

    DirectionalLight

  • Destroy component

    Returns void

    Component

  • Clear subscribers

    Returns void

    EventDispatcher

  • Emit event

    Parameters

    • event: {
          type: string;
          [key: string]: any;
      }
      • [key: string]: any
      • type: string

    Returns void

    EventDispatcher

  • Unsubscribe a event, if the callback param is not defined, all subscribers of this type will be removed.

    Parameters

    Returns void

    EventDispatcher

  • Subscribe a event

    Parameters

    • type: string

      event type

    • callback: SubscriberCallbackFn

      callback functions

    • Optionaloptions: {
          priority?: Priority;
          target?: any;
      } = {}

      options

      • Optionalpriority?: Priority
      • Optionaltarget?: any

    Returns void

    EventDispatcher

  • Subscribe a event, just emit once

    Parameters

    Returns void

    EventDispatcher

  • Set target

    Parameters

    • target: Vector3
    • OptionalworldSpace: boolean = false

    Returns void

    DirectionalLight

  • Translate target along axis

    Parameters

    • axis: Vector3
    • distance: number

    Returns void

    DirectionalLight