mirror of
https://github.com/gongxh0901/kunpocc-behaviortree.git
synced 2025-12-26 16:48:56 +00:00
行为树详细介绍的文档
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "de9afb2e-952c-4e0b-96df-cc676989bed9",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "d5a536b5-db1b-42ac-8654-5f6a81341c3a",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "6b9b2da1-08c2-4c40-ab35-e7cb5bb30872",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,147 +0,0 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "spineboy",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"persistent": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "spineboy",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": null,
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 4
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": -1000
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0.3,
|
||||
"y": 0.3,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 3
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 419.8399963378906,
|
||||
"height": 686.0800170898438
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.45412539378136013,
|
||||
"y": 0.011660447470739235
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "dfVeZdqm9E15k7OBD615QP"
|
||||
},
|
||||
{
|
||||
"__type__": "sp.Skeleton",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_skeletonData": {
|
||||
"__uuid__": "39a7d8cd-533a-479a-b909-9575bf720338",
|
||||
"__expectedType__": "sp.SkeletonData"
|
||||
},
|
||||
"defaultSkin": "default",
|
||||
"defaultAnimation": "jump",
|
||||
"_premultipliedAlpha": true,
|
||||
"_timeScale": 1,
|
||||
"_preCacheMode": 0,
|
||||
"_cacheMode": 0,
|
||||
"_sockets": [],
|
||||
"_useTint": false,
|
||||
"_debugMesh": false,
|
||||
"_debugBones": false,
|
||||
"_debugSlots": false,
|
||||
"_enableBatch": false,
|
||||
"loop": true,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "deHPJ9jpdJZq/2PP1E2haI"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "fcg4LyhU9MpITaQy7lW8Ru",
|
||||
"instance": null,
|
||||
"targetOverrides": null
|
||||
}
|
||||
]
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.50",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "610db270-416d-42a9-a228-67b0fe1beee4",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "spineboy"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 824 KiB After Width: | Height: | Size: 824 KiB |
@@ -23,7 +23,7 @@
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 22
|
||||
"__id__": 14
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -54,7 +54,7 @@
|
||||
},
|
||||
"autoReleaseAssets": false,
|
||||
"_globals": {
|
||||
"__id__": 25
|
||||
"__id__": 17
|
||||
},
|
||||
"_id": "bef93422-3e63-4c0f-a5cf-d926e7360673"
|
||||
},
|
||||
@@ -71,22 +71,22 @@
|
||||
"__id__": 3
|
||||
},
|
||||
{
|
||||
"__id__": 6
|
||||
"__id__": 9
|
||||
},
|
||||
{
|
||||
"__id__": 8
|
||||
"__id__": 7
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 19
|
||||
"__id__": 11
|
||||
},
|
||||
{
|
||||
"__id__": 20
|
||||
"__id__": 12
|
||||
},
|
||||
{
|
||||
"__id__": 21
|
||||
"__id__": 13
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
@@ -199,13 +199,121 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"skeleton": null,
|
||||
"btConfig": {
|
||||
"__uuid__": "c8aeef5d-6d0e-4093-848e-7d8f1ca30261",
|
||||
"__expectedType__": "cc.JsonAsset"
|
||||
"skeleton": {
|
||||
"__id__": 6
|
||||
},
|
||||
"btConfig": null,
|
||||
"_id": "69LhmWaZRIUpmYvdiN82Ha"
|
||||
},
|
||||
{
|
||||
"__type__": "sp.Skeleton",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_skeletonData": {
|
||||
"__uuid__": "39a7d8cd-533a-479a-b909-9575bf720338",
|
||||
"__expectedType__": "sp.SkeletonData"
|
||||
},
|
||||
"defaultSkin": "default",
|
||||
"defaultAnimation": "idle",
|
||||
"_premultipliedAlpha": true,
|
||||
"_timeScale": 1,
|
||||
"_preCacheMode": 0,
|
||||
"_cacheMode": 0,
|
||||
"_sockets": [],
|
||||
"_useTint": false,
|
||||
"_debugMesh": false,
|
||||
"_debugBones": false,
|
||||
"_debugSlots": false,
|
||||
"_enableBatch": false,
|
||||
"loop": false,
|
||||
"_id": "e0SlYqh/pPzaLrAWsV78xj"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "spineboy",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 8
|
||||
},
|
||||
{
|
||||
"__id__": 6
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": -151.948,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0.5,
|
||||
"y": 0.5,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "a62KjBSsBMSpCYMjsx0oxG"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 419.8399963378906,
|
||||
"height": 686.0800170898438
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.45412539378136013,
|
||||
"y": 0.011660447470739235
|
||||
},
|
||||
"_id": "c9XaAZS6pNILxWx4jmSYKE"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Camera",
|
||||
@@ -218,7 +326,7 @@
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 7
|
||||
"__id__": 10
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
@@ -257,7 +365,7 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 6
|
||||
"__id__": 9
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
@@ -297,149 +405,6 @@
|
||||
"_trackingType": 0,
|
||||
"_id": "63WIch3o5BEYRlXzTT0oWc"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_prefab": {
|
||||
"__id__": 9
|
||||
},
|
||||
"__editorExtras__": {}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 8
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "610db270-416d-42a9-a228-67b0fe1beee4",
|
||||
"__expectedType__": "cc.Prefab"
|
||||
},
|
||||
"fileId": "fcg4LyhU9MpITaQy7lW8Ru",
|
||||
"instance": {
|
||||
"__id__": 10
|
||||
},
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInstance",
|
||||
"fileId": "2eYzhZYv5Mi5OETcYel3W3",
|
||||
"prefabRootNode": null,
|
||||
"mountedChildren": [],
|
||||
"mountedComponents": [],
|
||||
"propertyOverrides": [
|
||||
{
|
||||
"__id__": 11
|
||||
},
|
||||
{
|
||||
"__id__": 13
|
||||
},
|
||||
{
|
||||
"__id__": 14
|
||||
},
|
||||
{
|
||||
"__id__": 15
|
||||
},
|
||||
{
|
||||
"__id__": 16
|
||||
},
|
||||
{
|
||||
"__id__": 18
|
||||
}
|
||||
],
|
||||
"removedComponents": []
|
||||
},
|
||||
{
|
||||
"__type__": "CCPropertyOverrideInfo",
|
||||
"targetInfo": {
|
||||
"__id__": 12
|
||||
},
|
||||
"propertyPath": [
|
||||
"_lpos"
|
||||
],
|
||||
"value": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.TargetInfo",
|
||||
"localID": [
|
||||
"fcg4LyhU9MpITaQy7lW8Ru"
|
||||
]
|
||||
},
|
||||
{
|
||||
"__type__": "CCPropertyOverrideInfo",
|
||||
"targetInfo": {
|
||||
"__id__": 12
|
||||
},
|
||||
"propertyPath": [
|
||||
"_name"
|
||||
],
|
||||
"value": "spineboy"
|
||||
},
|
||||
{
|
||||
"__type__": "CCPropertyOverrideInfo",
|
||||
"targetInfo": {
|
||||
"__id__": 12
|
||||
},
|
||||
"propertyPath": [
|
||||
"_lrot"
|
||||
],
|
||||
"value": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "CCPropertyOverrideInfo",
|
||||
"targetInfo": {
|
||||
"__id__": 12
|
||||
},
|
||||
"propertyPath": [
|
||||
"_euler"
|
||||
],
|
||||
"value": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "CCPropertyOverrideInfo",
|
||||
"targetInfo": {
|
||||
"__id__": 17
|
||||
},
|
||||
"propertyPath": [
|
||||
"defaultAnimation"
|
||||
],
|
||||
"value": "idle"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.TargetInfo",
|
||||
"localID": [
|
||||
"deHPJ9jpdJZq/2PP1E2haI"
|
||||
]
|
||||
},
|
||||
{
|
||||
"__type__": "CCPropertyOverrideInfo",
|
||||
"targetInfo": {
|
||||
"__id__": 17
|
||||
},
|
||||
"propertyPath": [
|
||||
"_premultipliedAlpha"
|
||||
],
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
@@ -473,7 +438,7 @@
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_cameraComponent": {
|
||||
"__id__": 7
|
||||
"__id__": 10
|
||||
},
|
||||
"_alignCanvasWithScreen": true,
|
||||
"_id": "12O/ljcVlEqLmVm3U2gEOQ"
|
||||
@@ -516,12 +481,7 @@
|
||||
"instance": null,
|
||||
"targetOverrides": [
|
||||
{
|
||||
"__id__": 23
|
||||
}
|
||||
],
|
||||
"nestedPrefabInstanceRoots": [
|
||||
{
|
||||
"__id__": 8
|
||||
"__id__": 15
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -534,11 +494,9 @@
|
||||
"propertyPath": [
|
||||
"skeleton"
|
||||
],
|
||||
"target": {
|
||||
"__id__": 8
|
||||
},
|
||||
"target": null,
|
||||
"targetInfo": {
|
||||
"__id__": 24
|
||||
"__id__": 16
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -550,28 +508,28 @@
|
||||
{
|
||||
"__type__": "cc.SceneGlobals",
|
||||
"ambient": {
|
||||
"__id__": 26
|
||||
"__id__": 18
|
||||
},
|
||||
"shadows": {
|
||||
"__id__": 27
|
||||
"__id__": 19
|
||||
},
|
||||
"_skybox": {
|
||||
"__id__": 28
|
||||
"__id__": 20
|
||||
},
|
||||
"fog": {
|
||||
"__id__": 29
|
||||
"__id__": 21
|
||||
},
|
||||
"octree": {
|
||||
"__id__": 30
|
||||
"__id__": 22
|
||||
},
|
||||
"skin": {
|
||||
"__id__": 31
|
||||
"__id__": 23
|
||||
},
|
||||
"lightProbeInfo": {
|
||||
"__id__": 32
|
||||
"__id__": 24
|
||||
},
|
||||
"postSettings": {
|
||||
"__id__": 33
|
||||
"__id__": 25
|
||||
},
|
||||
"bakedWithStationaryMainLight": false,
|
||||
"bakedWithHighpLightmap": false
|
||||
|
||||
@@ -47,7 +47,7 @@ export class BTAnimation extends BT.LeafNode {
|
||||
}
|
||||
|
||||
/** 条件节点 */
|
||||
@BT.ClassCondition("BTConditionRandom", { name: "随机条件节点", group: "基础条件节点", desc: "随机0-1的值,大于设置值返回成功,否则返回失败" })
|
||||
@BT.ClassCondition("BTConditionRandom", { name: "随机条件节点", group: "基础条件节点", desc: "随机0-1的值,小于设置值返回成功,否则返回失败" })
|
||||
export class BTConditionRandom extends BT.Condition {
|
||||
|
||||
@BT.prop({ type: BT.ParamType.float, description: "值", defaultValue: 0.5 })
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
interface Math {
|
||||
/**
|
||||
* 限制值
|
||||
* @param value 当前值
|
||||
* @param min 最小值
|
||||
* @param max 最大值
|
||||
*/
|
||||
clampf(value: number, min: number, max: number): number;
|
||||
|
||||
/**
|
||||
* 随机从 min 到 max 的整数(包含min和max)
|
||||
* @param min
|
||||
* @param max
|
||||
*/
|
||||
rand(min: number, max: number): number;
|
||||
|
||||
/**
|
||||
* 随机从 min 到 max的数
|
||||
* @param min
|
||||
* @param max
|
||||
*/
|
||||
randRange(min: number, max: number): number;
|
||||
|
||||
/**
|
||||
* 角度转弧度
|
||||
* @param angle 角度
|
||||
*/
|
||||
rad(angle: number): number;
|
||||
|
||||
/**
|
||||
* 弧度转角度
|
||||
* @param radian 弧度
|
||||
*/
|
||||
deg(radian: number): number;
|
||||
|
||||
/**
|
||||
* 数值平滑渐变
|
||||
* @param num1
|
||||
* @param num2
|
||||
* @param elapsedTime
|
||||
* @param responseTime
|
||||
*/
|
||||
smooth(num1: number, num2: number, elapsedTime: number, responseTime: number): number;
|
||||
}
|
||||
|
||||
Math.clampf = function (value: number, min: number, max: number): number {
|
||||
return Math.min(Math.max(value, min), max);
|
||||
};
|
||||
|
||||
Math.rand = function (min: number, max: number): number {
|
||||
return Math.floor(Math.random() * (max - min + 1) + min);
|
||||
};
|
||||
|
||||
Math.randRange = function (min: number, max: number): number {
|
||||
return Math.random() * (max - min) + min;
|
||||
};
|
||||
|
||||
Math.rad = function (angle: number): number {
|
||||
return (angle * Math.PI) / 180;
|
||||
};
|
||||
|
||||
Math.deg = function (radian: number): number {
|
||||
return (radian * 180) / Math.PI;
|
||||
};
|
||||
|
||||
Math.smooth = function (num1: number, num2: number, elapsedTime: number, responseTime: number): number {
|
||||
let out: number = num1;
|
||||
if (elapsedTime > 0) {
|
||||
out = out + (num2 - num1) * (elapsedTime / (elapsedTime + responseTime));
|
||||
}
|
||||
return out;
|
||||
};
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "a336ce23-5d73-4280-b2e9-084389a3877e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user