Members
self :any
行为目标自身
Type:
- any
- Source
behaviors :Array.<BehaviorTargetBehavior>
行为目标所具有的行为
Type:
- Array.<BehaviorTargetBehavior>
- Source
onTickEvent :EasyBox3Lib.onTickEventToken|undefined
Type:
- EasyBox3Lib.
onTickEventToken |undefined
- Source
data
行为对象数据
- Source
self :any
行为目标自身
Type:
- any
- Source
behaviors :Array.<BehaviorTargetBehavior>
行为目标所具有的行为
Type:
- Array.<BehaviorTargetBehavior>
- Source
onTickEvent :EasyBox3Lib.onTickEventToken|undefined
Type:
- EasyBox3Lib.
onTickEventToken |undefined
- Source
data
行为对象数据
- Source
Methods
addBehavior(behavior, priority)
添加行为
Parameters:
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
priority | number | 行为优先级 |
- Source
removeBehavior(behavior)
移除行为
Parameters:
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
- Source
enableBehavior(behavior)
对该对象启用行为
Parameters:
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
- Source
disabledBehavior(behavior)
对该对象禁用行为
禁用后,该对象将不会执行该行为
Parameters:
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
- Source
hasBehavior(id) → {boolean}
检查是否有某种行为
Parameters:
| Name | Type | Description |
|---|---|---|
id | string | 行为id |
- Source
Returns:
是否有行为
- Type:
- boolean
(async) callBehavior(behaviorId, data) → {any}
调用其他行为的函数
Parameters:
| Name | Type | Description |
|---|---|---|
behaviorId | string | 要调用的行为id |
data | any | 传入行为的数据 |
- Source
Returns:
行为返回结果
- Type:
- any
createOnTickEvent(tpc, performanceImpact) → {EasyBox3Lib.onTickEventToken}
为该对象的行为创建onTick
Parameters:
| Name | Type | Description |
|---|---|---|
tpc | number | 每循环执行次数 |
performanceImpact | number | 性能影响程度 |
- Source
Returns:
事件令牌
- Type:
- EasyBox3Lib.
onTickEventToken
addBehavior(behavior, priority)
添加行为
Parameters:
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
priority | number | 行为优先级 |
- Source
removeBehavior(behavior)
移除行为
Parameters:
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
- Source
enableBehavior(behavior)
对该对象启用行为
Parameters:
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
- Source
disabledBehavior(behavior)
对该对象禁用行为
禁用后,该对象将不会执行该行为
Parameters:
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
- Source
hasBehavior(id) → {boolean}
检查是否有某种行为
Parameters:
| Name | Type | Description |
|---|---|---|
id | string | 行为id |
- Source
Returns:
是否有行为
- Type:
- boolean
(async) callBehavior(behaviorId, data) → {any}
调用其他行为的函数
Parameters:
| Name | Type | Description |
|---|---|---|
behaviorId | string | 要调用的行为id |
data | any | 传入行为的数据 |
- Source
Returns:
行为返回结果
- Type:
- any
createOnTickEvent(tpc, performanceImpact) → {EasyBox3Lib.onTickEventToken}
为该对象的行为创建onTick
Parameters:
| Name | Type | Description |
|---|---|---|
tpc | number | 每循环执行次数 |
performanceImpact | number | 性能影响程度 |
- Source
Returns:
事件令牌
- Type:
- EasyBox3Lib.
onTickEventToken