组件基类

### Hierarchy

- HashObject
  - Component

## Index

### Constructors

- constructor

### Properties

- _enabled
- _firstUpdate
- delayCallbacks
- entity

### Accessors

- enabled
- hashCode

### Methods

- $afterEditorUpdate
- $afterUpdate
- $onAwake
- $onEditorUpdate
- $onSleep
- $onUpdate
- _dealGlobalTouchBegin
- _dealGlobalTouchEnd
- _dealGlobalTouchMove
- _setup
- _unSetup
- afterEditorUpdate
- afterUpdate
- broadcast
- bubbling
- callOnNextTick
- cancelOnNextTick
- getDelayCallback
- invokeDelayCallback
- onAwake
- onCreate
- onDestroy
- onDisable
- onEditorUpdate
- onEnable
- onGlobalTouchBegin
- onGlobalTouchEnd
- onGlobalTouchMove
- onInteract
- onModify
- onSleep
- onUpdate

## Constructors

### constructor

- new Component(): Component

- Inherited from HashObject.constructor

  - Defined in core/HashObject.ts:15

  #### Returns Component

## Properties

### Protected _enabled

_enabled: boolean = EngineConfig.componentEnabled

- Defined in core/Component.ts:26

### Private _firstUpdate

_firstUpdate: boolean = EngineConfig.componentEnabled

- Defined in core/Component.ts:28

### Protected delayCallbacks

delayCallbacks: any[] = []

- Defined in core/Component.ts:23

### entity

entity: Entity

- Defined in core/Component.ts:22

所依附的实体

## Accessors

### enabled

enabled:

- Defined in core/Component.ts:33
- Defined in core/Component.ts:37

是否有效状态

### hashCode

hashCode:

Inherited from HashObject.hashCode

- Defined in core/HashObject.ts:21

## Methods

### $afterEditorUpdate

- $afterEditorUpdate(): void

- - Defined in core/Component.ts:129

  #### Returns void

### $afterUpdate

- $afterUpdate(): void

- - Defined in core/Component.ts:125

  #### Returns void

### $onAwake

- $onAwake(): void

- - Defined in core/Component.ts:81

  #### Returns void

### $onEditorUpdate

- $onEditorUpdate(t: any): void

- - Defined in core/Component.ts:121

  #### Parameters

  - ##### t: any

  #### Returns void

### $onSleep

- $onSleep(): void

- - Defined in core/Component.ts:168

  #### Returns void

### $onUpdate

- $onUpdate(t: any): void

- - Defined in core/Component.ts:108

  #### Parameters

  - ##### t: any

  #### Returns void

### _dealGlobalTouchBegin

- _dealGlobalTouchBegin(e: any): boolean

- - Defined in core/Component.ts:243

  #### Parameters

  - ##### e: any

  #### Returns boolean

### _dealGlobalTouchEnd

- _dealGlobalTouchEnd(e: any): boolean

- - Defined in core/Component.ts:251

  #### Parameters

  - ##### e: any

  #### Returns boolean

### _dealGlobalTouchMove

- _dealGlobalTouchMove(e: any): boolean

- - Defined in core/Component.ts:247

  #### Parameters

  - ##### e: any

  #### Returns boolean

### _setup

- _setup(entity: Entity ): void

- - Defined in core/Component.ts:57

  装配实体

  #### Parameters

  - ##### entity: Entity

  #### Returns void

### _unSetup

- _unSetup(): void

- - Defined in core/Component.ts:67

  卸载实体

  #### Returns void

### afterEditorUpdate

- afterEditorUpdate(): void

- - Defined in core/Component.ts:164

  #### Returns void

### afterUpdate

- afterUpdate(): void

- - Defined in core/Component.ts:160

  当子节点的时钟更新结束后

  #### Returns void

### broadcast

- broadcast(method: any, level?: number, ...params: any[]): void

- - Defined in core/Component.ts:286

  向下广播 如果某组件调用后返回true，将结束整条链

  #### Parameters

  - ##### method: any

    方法名

  - ##### Default value level: number = -1

    深度，默认全部遍历

  - ##### Rest ...params: any[]

    参数

  #### Returns void

### bubbling

- bubbling(method: any, ...params: any[]): void

- - Defined in core/Component.ts:296

  向上冒泡 如果某组件调用后返回true，将结束整条链

  #### Parameters

  - ##### method: any

    方法名

  - ##### Rest ...params: any[]

    参数

  #### Returns void

### callOnNextTick

- callOnNextTick(callback: any, once?: boolean): void

- - Defined in core/Component.ts:214

  执行延迟回调

  #### Parameters

  - ##### callback: any

  - ##### Default value once: boolean = true

    是否只执行一次

  #### Returns void

### cancelOnNextTick

- cancelOnNextTick(callback: any): void

- - Defined in core/Component.ts:221

  #### Parameters

  - ##### callback: any

  #### Returns void

### Private getDelayCallback

- getDelayCallback(callback: any): any

- - Defined in core/Component.ts:198

  #### Parameters

  - ##### callback: any

  #### Returns any

### Private invokeDelayCallback

- invokeDelayCallback(t: any): void

- - Defined in core/Component.ts:133

  #### Parameters

  - ##### t: any

  #### Returns void

### onAwake

- onAwake(): void

- - Defined in core/Component.ts:90

  当组件被唤醒时

  #### Returns void

### onCreate

- onCreate(): void

- - Defined in core/Component.ts:77

  当组件被创建时

  #### Returns void

### onDestroy

- onDestroy(): void

- - Defined in core/Component.ts:184

  当组件被销毁时

  #### Returns void

### onDisable

- onDisable(): void

- - Defined in core/Component.ts:104

  当组件失效时

  #### Returns void

### onEditorUpdate

- onEditorUpdate(t: any): void

- - Defined in core/Component.ts:153

  #### Parameters

  - ##### t: any

  #### Returns void

### onEnable

- onEnable(): void

- - Defined in core/Component.ts:97

  当组件生效时

  #### Returns void

### onGlobalTouchBegin

- onGlobalTouchBegin(e: any): boolean

- - Defined in core/Component.ts:259

  当全局触摸开始

  #### Parameters

  - ##### e: any

  #### Returns boolean

### onGlobalTouchEnd

- onGlobalTouchEnd(e: any): boolean

- - Defined in core/Component.ts:275

  当全触摸结束

  #### Parameters

  - ##### e: any

  #### Returns boolean

### onGlobalTouchMove

- onGlobalTouchMove(e: any): boolean

- - Defined in core/Component.ts:267

  当全触摸移动

  #### Parameters

  - ##### e: any

  #### Returns boolean

### onInteract

- onInteract(type: any, event: any): any

- - Defined in core/Component.ts:234

  当交互时

  #### Parameters

  - ##### type: any

  - ##### event: any

  #### Returns any

### Protected onModify

- onModify(value: any, key: any, oldValue: any): void

- - Defined in core/Component.ts:194

  当被监听的属性被修改时

  #### Parameters

  - ##### value: any

  - ##### key: any

  - ##### oldValue: any

  #### Returns void

### onSleep

- onSleep(): void

- - Defined in core/Component.ts:177

  当组件沉睡时

  #### Returns void

### onUpdate

- onUpdate(t: any): void

- - Defined in core/Component.ts:149

  当时钟更新时

  #### Parameters

  - ##### t: any

    从引擎开始到当前的毫秒数

  #### Returns void

Generated using TypeDoc