采矿行为树示例
This commit is contained in:
@@ -1,111 +0,0 @@
|
||||
{
|
||||
"name": "miner-ai",
|
||||
"description": "简化版矿工AI - 挖矿存储循环",
|
||||
"blackboard": {
|
||||
"variables": [
|
||||
{
|
||||
"name": "unitType",
|
||||
"type": "string",
|
||||
"value": "miner",
|
||||
"group": "基础属性",
|
||||
"description": "单位类型"
|
||||
},
|
||||
{
|
||||
"name": "currentCommand",
|
||||
"type": "string",
|
||||
"value": "mine",
|
||||
"group": "命令状态",
|
||||
"description": "当前命令"
|
||||
},
|
||||
{
|
||||
"name": "hasOre",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"group": "工作状态",
|
||||
"description": "是否携带矿石"
|
||||
},
|
||||
{
|
||||
"name": "targetPosition",
|
||||
"type": "vector3",
|
||||
"value": null,
|
||||
"group": "移动属性",
|
||||
"description": "目标位置"
|
||||
},
|
||||
{
|
||||
"name": "hasTarget",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"group": "移动属性",
|
||||
"description": "是否有目标"
|
||||
},
|
||||
{
|
||||
"name": "isMoving",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"group": "移动属性",
|
||||
"description": "是否正在移动"
|
||||
},
|
||||
{
|
||||
"name": "currentHealth",
|
||||
"type": "number",
|
||||
"value": 100,
|
||||
"group": "基础属性",
|
||||
"description": "当前生命值"
|
||||
},
|
||||
{
|
||||
"name": "maxHealth",
|
||||
"type": "number",
|
||||
"value": 100,
|
||||
"group": "基础属性",
|
||||
"description": "最大生命值"
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"type": "selector",
|
||||
"name": "矿工主选择器",
|
||||
"children": [
|
||||
{
|
||||
"type": "sequence",
|
||||
"name": "存储矿石序列",
|
||||
"children": [
|
||||
{
|
||||
"type": "blackboard-value-comparison",
|
||||
"name": "检查是否携带矿石",
|
||||
"variable": "hasOre",
|
||||
"operator": "==",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"type": "execute-action",
|
||||
"name": "前往仓库存储",
|
||||
"action": "store-ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "sequence",
|
||||
"name": "挖矿序列",
|
||||
"children": [
|
||||
{
|
||||
"type": "blackboard-value-comparison",
|
||||
"name": "检查是否没有矿石",
|
||||
"variable": "hasOre",
|
||||
"operator": "==",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"type": "execute-action",
|
||||
"name": "寻找并挖掘矿石",
|
||||
"action": "find-and-mine-ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "execute-action",
|
||||
"name": "默认待机",
|
||||
"action": "idle-behavior"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,454 +0,0 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "root",
|
||||
"type": "root",
|
||||
"name": "矿工AI根节点",
|
||||
"position": {
|
||||
"x": 400,
|
||||
"y": 100
|
||||
},
|
||||
"properties": {},
|
||||
"children": [
|
||||
"main-selector"
|
||||
],
|
||||
"canHaveChildren": true,
|
||||
"canHaveParent": false,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "main-selector",
|
||||
"type": "selector",
|
||||
"name": "矿工主选择器",
|
||||
"position": {
|
||||
"x": 400,
|
||||
"y": 200
|
||||
},
|
||||
"properties": {
|
||||
"description": {
|
||||
"name": "描述",
|
||||
"type": "string",
|
||||
"value": "矿工主要行为选择:有矿石就存储,没矿石就挖矿,否则待机",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
"store-conditional",
|
||||
"mine-conditional",
|
||||
"idle-action"
|
||||
],
|
||||
"canHaveChildren": true,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "store-conditional",
|
||||
"type": "conditional-decorator",
|
||||
"name": "检查是否携带矿石",
|
||||
"position": {
|
||||
"x": 200,
|
||||
"y": 250
|
||||
},
|
||||
"properties": {
|
||||
"conditionType": {
|
||||
"name": "条件类型",
|
||||
"type": "string",
|
||||
"value": "blackboardCompare",
|
||||
"description": "条件判断类型",
|
||||
"required": false
|
||||
},
|
||||
"executeWhenTrue": {
|
||||
"name": "条件为真时执行",
|
||||
"type": "boolean",
|
||||
"value": true,
|
||||
"description": "条件为真时是否执行子节点",
|
||||
"required": false
|
||||
},
|
||||
"executeWhenFalse": {
|
||||
"name": "条件为假时执行",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "条件为假时是否执行子节点",
|
||||
"required": false
|
||||
},
|
||||
"checkInterval": {
|
||||
"name": "检查间隔",
|
||||
"type": "number",
|
||||
"value": 0,
|
||||
"description": "条件检查间隔时间(秒),0表示每帧检查",
|
||||
"required": false
|
||||
},
|
||||
"abortType": {
|
||||
"name": "中止类型",
|
||||
"type": "select",
|
||||
"value": "None",
|
||||
"description": "决定节点在何种情况下会被中止",
|
||||
"options": ["None", "LowerPriority", "Self", "Both"],
|
||||
"required": false
|
||||
},
|
||||
"shouldReevaluate": true,
|
||||
"variableName": "hasOre",
|
||||
"operator": "equal",
|
||||
"compareValue": "true"
|
||||
},
|
||||
"children": [
|
||||
"store-sequence"
|
||||
],
|
||||
"attachedCondition": {
|
||||
"type": "blackboard-value-comparison",
|
||||
"name": "黑板值比较",
|
||||
"icon": "⚖️"
|
||||
},
|
||||
"conditionExpanded": false,
|
||||
"canHaveChildren": true,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "mine-conditional",
|
||||
"type": "conditional-decorator",
|
||||
"name": "检查是否没有矿石",
|
||||
"position": {
|
||||
"x": 400,
|
||||
"y": 250
|
||||
},
|
||||
"properties": {
|
||||
"conditionType": {
|
||||
"name": "条件类型",
|
||||
"type": "string",
|
||||
"value": "blackboardCompare",
|
||||
"description": "条件判断类型",
|
||||
"required": false
|
||||
},
|
||||
"executeWhenTrue": {
|
||||
"name": "条件为真时执行",
|
||||
"type": "boolean",
|
||||
"value": true,
|
||||
"description": "条件为真时是否执行子节点",
|
||||
"required": false
|
||||
},
|
||||
"executeWhenFalse": {
|
||||
"name": "条件为假时执行",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "条件为假时是否执行子节点",
|
||||
"required": false
|
||||
},
|
||||
"checkInterval": {
|
||||
"name": "检查间隔",
|
||||
"type": "number",
|
||||
"value": 0,
|
||||
"description": "条件检查间隔时间(秒),0表示每帧检查",
|
||||
"required": false
|
||||
},
|
||||
"abortType": {
|
||||
"name": "中止类型",
|
||||
"type": "select",
|
||||
"value": "None",
|
||||
"description": "决定节点在何种情况下会被中止",
|
||||
"options": ["None", "LowerPriority", "Self", "Both"],
|
||||
"required": false
|
||||
},
|
||||
"shouldReevaluate": true,
|
||||
"variableName": "hasOre",
|
||||
"operator": "equal",
|
||||
"compareValue": "false"
|
||||
},
|
||||
"children": [
|
||||
"mine-sequence"
|
||||
],
|
||||
"attachedCondition": {
|
||||
"type": "blackboard-value-comparison",
|
||||
"name": "黑板值比较",
|
||||
"icon": "⚖️"
|
||||
},
|
||||
"conditionExpanded": false,
|
||||
"canHaveChildren": true,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "store-sequence",
|
||||
"type": "sequence",
|
||||
"name": "存储矿石序列",
|
||||
"position": {
|
||||
"x": 200,
|
||||
"y": 350
|
||||
},
|
||||
"properties": {
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "string",
|
||||
"value": "去仓库存储矿石,然后设置状态为无矿石",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
"store-ore-action",
|
||||
"set-no-ore"
|
||||
],
|
||||
"canHaveChildren": true,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "mine-sequence",
|
||||
"type": "sequence",
|
||||
"name": "挖矿序列",
|
||||
"position": {
|
||||
"x": 400,
|
||||
"y": 350
|
||||
},
|
||||
"properties": {
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "string",
|
||||
"value": "寻找并挖掘矿石,然后设置状态为有矿石",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
"mine-ore-action",
|
||||
"set-has-ore"
|
||||
],
|
||||
"canHaveChildren": true,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "store-ore-action",
|
||||
"type": "event-action",
|
||||
"name": "前往仓库存储",
|
||||
"position": {
|
||||
"x": 150,
|
||||
"y": 450
|
||||
},
|
||||
"properties": {
|
||||
"eventName": {
|
||||
"name": "事件名称",
|
||||
"type": "string",
|
||||
"value": "store-ore",
|
||||
"description": "要执行的事件名称",
|
||||
"required": true
|
||||
},
|
||||
"parameters": {
|
||||
"name": "事件参数",
|
||||
"type": "string",
|
||||
"value": "{}",
|
||||
"description": "传递给事件处理函数的参数(JSON格式)",
|
||||
"required": false
|
||||
},
|
||||
"timeout": {
|
||||
"name": "超时时间",
|
||||
"type": "number",
|
||||
"value": 0,
|
||||
"description": "事件执行超时时间(秒),0表示无限制",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"canHaveChildren": false,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "set-no-ore",
|
||||
"type": "set-blackboard-value",
|
||||
"name": "设置无矿石状态",
|
||||
"position": {
|
||||
"x": 250,
|
||||
"y": 450
|
||||
},
|
||||
"properties": {
|
||||
"variableName": {
|
||||
"name": "变量名",
|
||||
"type": "string",
|
||||
"value": "hasOre",
|
||||
"description": "黑板变量名",
|
||||
"required": true
|
||||
},
|
||||
"value": {
|
||||
"name": "设置值",
|
||||
"type": "string",
|
||||
"value": "false",
|
||||
"description": "要设置的值(留空则使用源变量)",
|
||||
"required": false
|
||||
},
|
||||
"force": {
|
||||
"name": "强制设置",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "是否忽略只读限制",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"canHaveChildren": false,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "mine-ore-action",
|
||||
"type": "event-action",
|
||||
"name": "寻找并挖掘矿石",
|
||||
"position": {
|
||||
"x": 350,
|
||||
"y": 450
|
||||
},
|
||||
"properties": {
|
||||
"eventName": {
|
||||
"name": "事件名称",
|
||||
"type": "string",
|
||||
"value": "find-and-mine-ore",
|
||||
"description": "要执行的事件名称",
|
||||
"required": true
|
||||
},
|
||||
"parameters": {
|
||||
"name": "事件参数",
|
||||
"type": "string",
|
||||
"value": "{}",
|
||||
"description": "传递给事件处理函数的参数(JSON格式)",
|
||||
"required": false
|
||||
},
|
||||
"timeout": {
|
||||
"name": "超时时间",
|
||||
"type": "number",
|
||||
"value": 0,
|
||||
"description": "事件执行超时时间(秒),0表示无限制",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"canHaveChildren": false,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "set-has-ore",
|
||||
"type": "set-blackboard-value",
|
||||
"name": "设置有矿石状态",
|
||||
"position": {
|
||||
"x": 450,
|
||||
"y": 450
|
||||
},
|
||||
"properties": {
|
||||
"variableName": {
|
||||
"name": "变量名",
|
||||
"type": "string",
|
||||
"value": "hasOre",
|
||||
"description": "黑板变量名",
|
||||
"required": true
|
||||
},
|
||||
"value": {
|
||||
"name": "设置值",
|
||||
"type": "string",
|
||||
"value": "true",
|
||||
"description": "要设置的值(留空则使用源变量)",
|
||||
"required": false
|
||||
},
|
||||
"force": {
|
||||
"name": "强制设置",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "是否忽略只读限制",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"canHaveChildren": false,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
},
|
||||
{
|
||||
"id": "idle-action",
|
||||
"type": "event-action",
|
||||
"name": "默认待机",
|
||||
"position": {
|
||||
"x": 600,
|
||||
"y": 250
|
||||
},
|
||||
"properties": {
|
||||
"eventName": {
|
||||
"name": "事件名称",
|
||||
"type": "string",
|
||||
"value": "idle-behavior",
|
||||
"description": "要执行的事件名称",
|
||||
"required": true
|
||||
},
|
||||
"parameters": {
|
||||
"name": "事件参数",
|
||||
"type": "string",
|
||||
"value": "{}",
|
||||
"description": "传递给事件处理函数的参数(JSON格式)",
|
||||
"required": false
|
||||
},
|
||||
"timeout": {
|
||||
"name": "超时时间",
|
||||
"type": "number",
|
||||
"value": 0,
|
||||
"description": "事件执行超时时间(秒),0表示无限制",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"canHaveChildren": false,
|
||||
"canHaveParent": true,
|
||||
"hasError": false
|
||||
}
|
||||
],
|
||||
"connections": [],
|
||||
"metadata": {
|
||||
"name": "miner-ai",
|
||||
"description": "矿工AI示例 - 展示条件装饰器的正确使用方式",
|
||||
"version": "1.0",
|
||||
"created": "2025-06-24T15:00:13.826Z"
|
||||
},
|
||||
"blackboard": [
|
||||
{
|
||||
"name": "unitType",
|
||||
"type": "string",
|
||||
"value": "miner",
|
||||
"description": "单位类型 - 可拖拽到事件参数中",
|
||||
"group": "基础属性"
|
||||
},
|
||||
{
|
||||
"name": "hasOre",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "是否携带矿石 - 核心状态变量,被条件节点和设置节点使用",
|
||||
"group": "工作状态"
|
||||
},
|
||||
{
|
||||
"name": "currentHealth",
|
||||
"type": "number",
|
||||
"value": 100,
|
||||
"description": "当前生命值 - 可拖拽用于健康检查条件",
|
||||
"group": "基础属性"
|
||||
},
|
||||
{
|
||||
"name": "maxHealth",
|
||||
"type": "number",
|
||||
"value": 100,
|
||||
"description": "最大生命值",
|
||||
"group": "基础属性"
|
||||
},
|
||||
{
|
||||
"name": "targetPosition",
|
||||
"type": "object",
|
||||
"value": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"description": "目标位置 - 移动系统使用",
|
||||
"group": "移动属性"
|
||||
},
|
||||
{
|
||||
"name": "isMoving",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "是否正在移动",
|
||||
"group": "移动属性"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,317 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "node_15iffhg4p",
|
||||
"type": "root",
|
||||
"name": "根节点",
|
||||
"description": "行为树的根节点,每棵树只能有一个根节点",
|
||||
"children": [
|
||||
"node_o6tsnrxyg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "node_o6tsnrxyg",
|
||||
"type": "selector",
|
||||
"name": "选择器",
|
||||
"description": "按顺序执行子节点,任一成功则整体成功",
|
||||
"properties": {
|
||||
"abortType": "LowerPriority"
|
||||
},
|
||||
"children": [
|
||||
"node_tljchzbno",
|
||||
"node_txhx0hau5",
|
||||
"node_r9kvcwv8u",
|
||||
"node_520hedw22"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "node_tljchzbno",
|
||||
"type": "conditional-decorator",
|
||||
"name": "休息条件装饰器",
|
||||
"description": "基于条件执行子节点(拖拽条件节点到此装饰器来配置条件)",
|
||||
"properties": {
|
||||
"conditionType": "blackboardCompare",
|
||||
"executeWhenTrue": true,
|
||||
"abortType": "LowerPriority",
|
||||
"shouldReevaluate": true,
|
||||
"variableName": "{{isLowStamina}}",
|
||||
"operator": "equal",
|
||||
"compareValue": "true"
|
||||
},
|
||||
"children": [
|
||||
"node_ulp8qx68h"
|
||||
],
|
||||
"condition": {
|
||||
"type": "blackboard-value-comparison",
|
||||
"properties": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_txhx0hau5",
|
||||
"type": "conditional-decorator",
|
||||
"name": "存储条件装饰器",
|
||||
"description": "基于条件执行子节点(拖拽条件节点到此装饰器来配置条件)",
|
||||
"properties": {
|
||||
"conditionType": "blackboardCompare",
|
||||
"executeWhenTrue": true,
|
||||
"abortType": "LowerPriority",
|
||||
"shouldReevaluate": true,
|
||||
"variableName": "{{hasOre}}",
|
||||
"operator": "equal",
|
||||
"compareValue": "true"
|
||||
},
|
||||
"children": [
|
||||
"node_dhsz8rgl1"
|
||||
],
|
||||
"condition": {
|
||||
"type": "blackboard-value-comparison",
|
||||
"properties": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_r9kvcwv8u",
|
||||
"type": "conditional-decorator",
|
||||
"name": "挖矿条件装饰器",
|
||||
"description": "基于条件执行子节点(拖拽条件节点到此装饰器来配置条件)",
|
||||
"properties": {
|
||||
"conditionType": "blackboardCompare",
|
||||
"executeWhenTrue": true,
|
||||
"abortType": "LowerPriority",
|
||||
"shouldReevaluate": true,
|
||||
"variableName": "{{isLowStamina}}",
|
||||
"operator": "equal",
|
||||
"compareValue": "false"
|
||||
},
|
||||
"children": [
|
||||
"node_zguxml6u7"
|
||||
],
|
||||
"condition": {
|
||||
"type": "blackboard-value-comparison",
|
||||
"properties": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_ulp8qx68h",
|
||||
"type": "sequence",
|
||||
"name": "序列器",
|
||||
"description": "按顺序执行子节点,任一失败则整体失败",
|
||||
"properties": {
|
||||
"abortType": "None"
|
||||
},
|
||||
"children": [
|
||||
"node_0fgq85ovw",
|
||||
"node_9v13vpqyr"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "node_0fgq85ovw",
|
||||
"type": "event-action",
|
||||
"name": "回家休息",
|
||||
"description": "执行已注册的事件处理函数(推荐)",
|
||||
"properties": {
|
||||
"eventName": "go-home-rest",
|
||||
"parameters": "{}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_9v13vpqyr",
|
||||
"type": "event-action",
|
||||
"name": "恢复体力",
|
||||
"description": "执行已注册的事件处理函数(推荐)",
|
||||
"properties": {
|
||||
"eventName": "recover-stamina",
|
||||
"parameters": "{}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_ui4ja9mlj",
|
||||
"type": "event-action",
|
||||
"name": "前往仓库存储",
|
||||
"description": "执行已注册的事件处理函数(推荐)",
|
||||
"properties": {
|
||||
"eventName": "store-ore",
|
||||
"parameters": "{}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_969njccy2",
|
||||
"type": "event-action",
|
||||
"name": "挖掘金矿",
|
||||
"description": "执行已注册的事件处理函数(推荐)",
|
||||
"properties": {
|
||||
"eventName": "mine-gold-ore",
|
||||
"parameters": "{}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_520hedw22",
|
||||
"type": "event-action",
|
||||
"name": "默认待机",
|
||||
"description": "执行已注册的事件处理函数(推荐)",
|
||||
"properties": {
|
||||
"eventName": "idle-behavior",
|
||||
"parameters": "{}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_o5c7hv5wx",
|
||||
"type": "set-blackboard-value",
|
||||
"name": "设置黑板变量",
|
||||
"description": "设置黑板变量的值",
|
||||
"properties": {
|
||||
"variableName": "{{hasOre}}",
|
||||
"value": "false"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_zf0sgkqev",
|
||||
"type": "set-blackboard-value",
|
||||
"name": "设置黑板变量",
|
||||
"description": "设置黑板变量的值",
|
||||
"properties": {
|
||||
"variableName": "{{hasOre}}",
|
||||
"value": "true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node_dhsz8rgl1",
|
||||
"type": "sequence",
|
||||
"name": "序列器",
|
||||
"description": "按顺序执行子节点,任一失败则整体失败",
|
||||
"properties": {
|
||||
"abortType": "None"
|
||||
},
|
||||
"children": [
|
||||
"node_ui4ja9mlj",
|
||||
"node_o5c7hv5wx"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "node_zguxml6u7",
|
||||
"type": "sequence",
|
||||
"name": "序列器",
|
||||
"description": "按顺序执行子节点,任一失败则整体失败",
|
||||
"properties": {
|
||||
"abortType": "None"
|
||||
},
|
||||
"children": [
|
||||
"node_969njccy2",
|
||||
"node_zf0sgkqev"
|
||||
]
|
||||
}
|
||||
],
|
||||
"blackboard": [
|
||||
{
|
||||
"name": "unitType",
|
||||
"type": "string",
|
||||
"value": "miner",
|
||||
"description": "单位类型",
|
||||
"group": "基础属性"
|
||||
},
|
||||
{
|
||||
"name": "currentHealth",
|
||||
"type": "number",
|
||||
"value": 100,
|
||||
"description": "当前生命值",
|
||||
"group": "基础属性"
|
||||
},
|
||||
{
|
||||
"name": "maxHealth",
|
||||
"type": "number",
|
||||
"value": 100,
|
||||
"description": "最大生命值",
|
||||
"group": "基础属性"
|
||||
},
|
||||
{
|
||||
"name": "stamina",
|
||||
"type": "number",
|
||||
"value": 100,
|
||||
"description": "当前体力值 - 挖矿会消耗体力",
|
||||
"group": "体力系统"
|
||||
},
|
||||
{
|
||||
"name": "maxStamina",
|
||||
"type": "number",
|
||||
"value": 100,
|
||||
"description": "最大体力值",
|
||||
"group": "体力系统"
|
||||
},
|
||||
{
|
||||
"name": "staminaPercentage",
|
||||
"type": "number",
|
||||
"value": 1,
|
||||
"description": "体力百分比",
|
||||
"group": "体力系统"
|
||||
},
|
||||
{
|
||||
"name": "isLowStamina",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "是否低体力 - 体力低于20%时为true",
|
||||
"group": "体力系统"
|
||||
},
|
||||
{
|
||||
"name": "isResting",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "是否正在休息",
|
||||
"group": "体力系统"
|
||||
},
|
||||
{
|
||||
"name": "homePosition",
|
||||
"type": "vector3",
|
||||
"value": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"description": "家的位置 - 矿工休息的地方",
|
||||
"group": "体力系统"
|
||||
},
|
||||
{
|
||||
"name": "hasOre",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "是否携带矿石",
|
||||
"group": "工作状态"
|
||||
},
|
||||
{
|
||||
"name": "currentCommand",
|
||||
"type": "string",
|
||||
"value": "mine",
|
||||
"description": "当前命令",
|
||||
"group": "工作状态"
|
||||
},
|
||||
{
|
||||
"name": "hasTarget",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "是否有目标",
|
||||
"group": "工作状态"
|
||||
},
|
||||
{
|
||||
"name": "targetPosition",
|
||||
"type": "vector3",
|
||||
"value": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"description": "目标位置",
|
||||
"group": "移动属性"
|
||||
},
|
||||
{
|
||||
"name": "isMoving",
|
||||
"type": "boolean",
|
||||
"value": false,
|
||||
"description": "是否正在移动",
|
||||
"group": "移动属性"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"name": "behavior-tree",
|
||||
"created": "2025-06-25T08:41:25.401Z",
|
||||
"version": "1.0",
|
||||
"exportType": "clean"
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"ver": "2.0.1",
|
||||
"importer": "json",
|
||||
"imported": true,
|
||||
"uuid": "7ecbbfe3-a63f-4558-89e2-85e3f084ee02",
|
||||
"uuid": "b328a163-97a8-4435-b87c-9369dd76862d",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
1395
extensions/cocos/cocos-ecs/assets/resources/miner-stamina-ai.btree
Normal file
1395
extensions/cocos/cocos-ecs/assets/resources/miner-stamina-ai.btree
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
"ver": "1.0.0",
|
||||
"importer": "*",
|
||||
"imported": true,
|
||||
"uuid": "2dded9a7-03cd-465f-8419-7199e562c403",
|
||||
"uuid": "24c6e7e6-4ff0-4e7b-b470-9468bfa66b5d",
|
||||
"files": [
|
||||
".btree",
|
||||
".json"
|
||||
Reference in New Issue
Block a user