BehaviorLib 库
用于控制实体/非实体行为的库
依赖EasyBox3Lib 0.1.6
- Version
- 0.0.6
- License
- MIT
- Source
- Version
- 0.0.6
- License
- MIT
- Source
Classes
Members
(inner, constant) EBL
EasyBox3Lib
- Source
(inner, constant) CONFIG
配置文件
- Source
(inner, constant) EBL_VERSION :Array.<number>
建议EasyBox3Lib版本
- Array.<number>
- Source
(inner, constant) VERSION :Array.<number>
当前版本
- Array.<number>
- Source
(inner) behaviorRegistry :Map.<string, Behavior>
- Map.<string, Behavior>
- Source
(inner, constant) EBL
EasyBox3Lib
- Source
(inner, constant) CONFIG
配置文件
- Source
(inner, constant) EBL_VERSION :Array.<number>
建议EasyBox3Lib版本
- Array.<number>
- Source
(inner, constant) VERSION :Array.<number>
当前版本
- Array.<number>
- Source
(inner) behaviorRegistry :Map.<string, Behavior>
- Map.<string, Behavior>
- Source
Methods
(inner) nullc(a, b) → {*}
空值合并
| Name | Type | Description |
|---|---|---|
a | * | |
b | * |
- Source
- Type:
- *
(inner) Behavior(该行为的id,不可重复, init, defaultPriority)
定义一种行为
| Name | Type | Description |
|---|---|---|
该行为的id,不可重复 | string | |
init | BehaviorInitCallback | 行为主函数 |
defaultPriority | number | 行为默认优先级,越高越先执行 |
- Source
(inner) registerBehavior(behavior)
注册一种行为
| Name | Type | Description |
|---|---|---|
behavior | Behavior | 要注册的行为 |
- Source
(inner) nullc(a, b) → {*}
空值合并
| Name | Type | Description |
|---|---|---|
a | * | |
b | * |
- Source
- Type:
- *
(inner) Behavior(该行为的id,不可重复, init, defaultPriority)
定义一种行为
| Name | Type | Description |
|---|---|---|
该行为的id,不可重复 | string | |
init | BehaviorInitCallback | 行为主函数 |
defaultPriority | number | 行为默认优先级,越高越先执行 |
- Source
(inner) registerBehavior(behavior)
注册一种行为
| Name | Type | Description |
|---|---|---|
behavior | Behavior | 要注册的行为 |
- Source
Type Definitions
(async) CallBehaviorCallback(behaviorId, data) → {any}
调用其他行为的函数
| Name | Type | Description |
|---|---|---|
behaviorId | string | 要调用的行为id |
data | any | 传入行动的数据 |
- Source
行为返回结果
- Type:
- any
(async) BehaviorInitCallback(self, data, callBehavior) → {any}
行为函数
| Name | Type | Description |
|---|---|---|
self | object | 行为自身 |
data | any | 行为数据。若不是 |
callBehavior | CallBehaviorCallback | 调用其他行为 |
- Source
行为返回结果
- Type:
- any
BehaviorGroupData
行为组数据
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
data | any | id为 |
- Source
BehaviorTargetBehavior
行为目标对象行为
| Name | Type | Description |
|---|---|---|
id | string | 行为/行为组id |
priority | number | 行为优先级 |
disabled | boolean | 是否禁用行为 |
- Source
(async) CallBehaviorCallback(behaviorId, data) → {any}
调用其他行为的函数
| Name | Type | Description |
|---|---|---|
behaviorId | string | 要调用的行为id |
data | any | 传入行动的数据 |
- Source
行为返回结果
- Type:
- any
(async) BehaviorInitCallback(self, data, callBehavior) → {any}
行为函数
| Name | Type | Description |
|---|---|---|
self | object | 行为自身 |
data | any | 行为数据。若不是 |
callBehavior | CallBehaviorCallback | 调用其他行为 |
- Source
行为返回结果
- Type:
- any
BehaviorGroupData
行为组数据
| Name | Type | Description |
|---|---|---|
behavior | string | 行为id |
data | any | id为 |
- Source
BehaviorTargetBehavior
行为目标对象行为
| Name | Type | Description |
|---|---|---|
id | string | 行为/行为组id |
priority | number | 行为优先级 |
disabled | boolean | 是否禁用行为 |
- Source