# Class EventDispatcher

#### Hierarchy

- EventDispatcher

- Defined in assets/core/common/event/EventDispatcher.ts:11

#####
Index

### Constructors

constructor

### Properties

_msg

### Methods

destroy
dispatchEvent
off
on

## Constructors

### constructor

- new EventDispatcher(): EventDispatcher

- #### Returns EventDispatcher

## Properties

### `Protected` _msg

_msg: null | MessageEventData = null

- Defined in assets/core/common/event/EventDispatcher.ts:12

## Methods

### destroy

- destroy(): void

- 销毁事件对象

  #### Returns void

  - Defined in assets/core/common/event/EventDispatcher.ts:52

### dispatchEvent

- dispatchEvent(event: string, args?: any): void

- 触发全局事件

  #### Parameters

  - ##### event: string

    事件名

  - ##### args: any = null

    事件参数

  #### Returns void

  - Defined in assets/core/common/event/EventDispatcher.ts:42

### off

- off(event: string): void

- 移除全局事件

  #### Parameters

  - ##### event: string

    事件名

  #### Returns void

  - Defined in assets/core/common/event/EventDispatcher.ts:31

### on

- on(event: string, listener: ListenerFunc, object: any): void

- 注册全局事件

  #### Parameters

  - ##### event: string

    事件名

  - ##### listener: ListenerFunc

    处理事件的侦听器函数

  - ##### object: any

    侦听函数绑定的作用域对象

  #### Returns void

  - Defined in assets/core/common/event/EventDispatcher.ts:20

Generated using TypeDoc