fix node layout error and support subtree
This commit is contained in:
1 parent
d3c5bf53e7
commit
258a006383
21 files changed
+6019
-11457
No files matched your search
@@ -1 +1,55 @@
|
||||
{"name":"hero","root":{"id":1,"name":"Selector","desc":"英雄测试AI","args":{},"children":[{"id":2,"name":"Sequence","desc":"攻击","args":{},"children":[{"id":3,"name":"FindEnemy","args":{"x":0,"y":0,"w":100,"h":50},"output":["enemy"]},{"id":4,"name":"Attack","args":{},"input":["enemy"]},{"id":5,"name":"Wait","args":{"time":10}}]},{"id":6,"name":"Sequence","desc":"移动","args":{},"children":[{"id":7,"name":"FindEnemy","args":{"w":1000,"h":500,"x":0,"y":0},"output":["enemy"]},{"id":8,"name":"MoveToTarget","args":{},"input":["enemy"]}]},{"id":9,"name":"Sequence","desc":"逃跑","args":{},"children":[{"id":10,"name":"GetHp","args":{},"output":["hp"]},{"id":11,"name":"Cmp","args":{"lt":50},"input":["hp"]},{"id":12,"name":"MoveToPos","args":{"x":0,"y":0}}]},{"id":13,"name":"Idle"}]},"desc":"英雄测试AI"}
|
||||
{
|
||||
"name": "hero",
|
||||
"root": {
|
||||
"id": 1,
|
||||
"name": "Selector",
|
||||
"desc": "英雄测试AI",
|
||||
"args": {},
|
||||
"children": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Sequence",
|
||||
"desc": "攻击",
|
||||
"args": {},
|
||||
"children": [
|
||||
{
|
||||
"id": 3,
|
||||
"name": "FindEnemy",
|
||||
"args": { "x": 0, "y": 0, "w": 100, "h": 50 },
|
||||
"output": ["enemy"]
|
||||
},
|
||||
{ "id": 4, "name": "Attack", "args": {}, "input": ["enemy"] },
|
||||
{ "id": 5, "name": "Wait", "args": { "time": 10 } }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"name": "Sequence",
|
||||
"desc": "移动",
|
||||
"args": {},
|
||||
"children": [
|
||||
{
|
||||
"id": 7,
|
||||
"name": "FindEnemy",
|
||||
"args": { "w": 1000, "h": 500, "x": 0, "y": 0 },
|
||||
"output": ["enemy"]
|
||||
},
|
||||
{ "id": 8, "name": "MoveToTarget", "args": {}, "input": ["enemy"] }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"name": "Sequence",
|
||||
"desc": "逃跑",
|
||||
"args": {},
|
||||
"children": [
|
||||
{ "id": 10, "name": "GetHp", "args": {}, "output": ["hp"] },
|
||||
{ "id": 11, "name": "Cmp", "args": { "lt": 50 }, "input": ["hp"] },
|
||||
{ "id": 12, "name": "MoveToPos", "args": { "x": 0, "y": 0 } }
|
||||
]
|
||||
},
|
||||
{ "id": 13, "name": "Idle" }
|
||||
]
|
||||
},
|
||||
"desc": "英雄测试AI"
|
||||
}
|
||||
@@ -18,10 +18,18 @@
|
||||
"args": {},
|
||||
"output": [
|
||||
"hp"
|
||||
],
|
||||
"children": [
|
||||
{
|
||||
"id": 4,
|
||||
"name": "Sequence",
|
||||
"desc": "新建行为树",
|
||||
"path": "subtree2.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"id": 6,
|
||||
"name": "Cmp",
|
||||
"args": {
|
||||
"gt": 50,
|
||||
@@ -32,17 +40,24 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"id": 7,
|
||||
"name": "Log",
|
||||
"desc": "攻击",
|
||||
"args": {
|
||||
"str": "Attack!"
|
||||
}
|
||||
},
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"name": "Sequence",
|
||||
"desc": "新建行为树",
|
||||
"path": "subtree1.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"id": 11,
|
||||
"name": "Log",
|
||||
"desc": "逃跑",
|
||||
"args": {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "subtree",
|
||||
"root": {
|
||||
"id": 1,
|
||||
"name": "Sequence",
|
||||
"desc": "新建行为树",
|
||||
"children": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Log",
|
||||
"args": {
|
||||
"str": "hello"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Wait",
|
||||
"args": {
|
||||
"time": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"desc": "子树1"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "subtree2",
|
||||
"root": {
|
||||
"id": 1,
|
||||
"name": "Sequence",
|
||||
"desc": "新建行为树",
|
||||
"children": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "unknow"
|
||||
}
|
||||
]
|
||||
},
|
||||
"desc": "子树2"
|
||||
}
|
||||
Reference in new issue
Block a user