Update README.md
This commit is contained in:
1 parent
ae3933b925
commit
ff214b2591
1 file changed
+9
-4
@@ -12,8 +12,13 @@
|
|||||||
|
|
||||||
## 节点定义
|
## 节点定义
|
||||||
```typescript
|
```typescript
|
||||||
|
interface NodeArgOption {
|
||||||
|
name: string;
|
||||||
|
value: string | number;
|
||||||
|
}
|
||||||
interface NodeArg {
|
interface NodeArg {
|
||||||
name: string, // 字段名
|
name: string, // 字段名
|
||||||
|
// string | string? | boolean | boolean?| int | int? | float | float? | code | code? | enum | enum?
|
||||||
type: string, // 字段类型
|
type: string, // 字段类型
|
||||||
desc: string, // 字段中文描述
|
desc: string, // 字段中文描述
|
||||||
default?: string; // 默认值
|
default?: string; // 默认值
|
||||||
@@ -24,11 +29,11 @@ interface NodeDef {
|
|||||||
type?: string; //节点分类(Composite,Decorator,Condition,Action)
|
type?: string; //节点分类(Composite,Decorator,Condition,Action)
|
||||||
desc?: string; //节点说明
|
desc?: string; //节点说明
|
||||||
args?: ArgsDefType[]; //参数列表
|
args?: ArgsDefType[]; //参数列表
|
||||||
input?: string[]; //输入变量名
|
input?: string[]; //输入变量名 exp: ["target", "enemy?"]
|
||||||
output?: string[]; //输出变量名
|
output?: string[]; //输出变量名 exp: ["target", "enemy?"]
|
||||||
doc?: string; //文档说明(markdown格式)
|
doc?: string; //文档说明(markdown格式)
|
||||||
color?: string; //节点颜色
|
color?: string; //节点颜色 exp: "#ff00ff"
|
||||||
icon?: string; //节点图标
|
icon?: string; //节点图标 exp: icons/cmp.svg
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
节点定义配置在项目创建的时候会自动生成一个配置,参照[sample/node-config.b3-setting](sample/node-config.b3-setting),这是个json的配置文件。编辑器不提供节点定义的编辑,强烈建议节点定义文件由代码生成 (参照示例项目[behavior3lua](https://github.com/zhandouxiaojiji/behavior3lua))。
|
节点定义配置在项目创建的时候会自动生成一个配置,参照[sample/node-config.b3-setting](sample/node-config.b3-setting),这是个json的配置文件。编辑器不提供节点定义的编辑,强烈建议节点定义文件由代码生成 (参照示例项目[behavior3lua](https://github.com/zhandouxiaojiji/behavior3lua))。
|
||||||
|
|||||||
Reference in new issue
Block a user