Options
All
  • Public
  • Public/Protected
  • All
Menu

The event system is used to communicate between different parts of the engine.

Hierarchy

  • EventSystem

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private subscribers

subscribers: Map<string, EventCallback<any>[]> = ...

Methods

dispatch

  • dispatch<T>(event: string, data?: T): boolean
  • Dispatches given event with it's data to all of the subscribers.

    Type parameters

    • T

    Parameters

    • event: string

      Event type.

    • Optional data: T

      Event data.

    Returns boolean

    True when successfully dispatched event, false when not.

off

  • Unsubscribe from the given event.

    When the callback is not specified, unsubscribe all the callbacks. from this event.

    Parameters

    • event: string

      Event type.

    • Optional callback: EventCallback<any>

      Callback function.

    Returns void

on

Generated using TypeDoc