Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Entity

Index

Constructors

constructor

  • new Entity(name?: string): Entity
  • Construct a new entity with the given name.

    Parameters

    • Optional name: string

      Name of the entity.

    Returns Entity

Properties

Private _id

_id: string

active

active: boolean = true

Is the entity active.

components

components: Set<Component> = ...

Entity's components.

name

name: string

Name of the entity.

scene

scene: Scene

Scene that this entity is in.

tag

tag: string = Tags.Untagged

Tag of the entity.

transform

transform: Transform

Entity's transform component.

Accessors

id

  • get id(): string

Methods

addComponent

awake

  • awake(): void

getComponent

  • getComponent<T>(component: Class<T>): T
  • Get a component from the entity.

    Type parameters

    Parameters

    • component: Class<T>

      Component to get.

    Returns T

    Component or null if not found.

lateUpdate

  • lateUpdate(): void

removeComponent

  • removeComponent<T>(component: Class<T>): boolean
  • Remove a component from the entity.

    Type parameters

    Parameters

    • component: Class<T>

      Component to remove.

    Returns boolean

    True if the component was removed, false if not.

start

  • start(): void

update

  • update(): void

Generated using TypeDoc