mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-25 22:23:42 +08:00
Add BoneLength expression.
This commit is contained in:
parent
a079413721
commit
f2c07a02ec
@ -763,6 +763,18 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "bone-length",
|
||||||
|
"expressionName": "BoneLength",
|
||||||
|
"highlight": false,
|
||||||
|
"returnType": "number",
|
||||||
|
"params": [
|
||||||
|
{
|
||||||
|
"id": "bone-name",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "bone-world-x",
|
"id": "bone-world-x",
|
||||||
"expressionName": "BoneWorldX",
|
"expressionName": "BoneWorldX",
|
||||||
|
|||||||
@ -76,6 +76,14 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Exps =
|
|||||||
return this.getBoneRotation(boneName);
|
return this.getBoneRotation(boneName);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
BoneLength (this: SpineC3Instance, boneName: string) {
|
||||||
|
const { skeleton } = this;
|
||||||
|
if (!skeleton) return 0;
|
||||||
|
const bone = skeleton.findBone(boneName);
|
||||||
|
if (!bone) return 0;
|
||||||
|
return bone.data.length;
|
||||||
|
},
|
||||||
|
|
||||||
BoneWorldX (this: SpineC3Instance, boneName: string) {
|
BoneWorldX (this: SpineC3Instance, boneName: string) {
|
||||||
return this.getBoneWorldX(boneName);
|
return this.getBoneWorldX(boneName);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -851,6 +851,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"bone-length": {
|
||||||
|
"description": "Get the length of a bone.",
|
||||||
|
"translated-name": "BoneLength",
|
||||||
|
"params": {
|
||||||
|
"bone-name": {
|
||||||
|
"name": "Bone name",
|
||||||
|
"desc": "Name of the bone"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"bone-world-x": {
|
"bone-world-x": {
|
||||||
"description": "Get the C3 world X position of a bone.",
|
"description": "Get the C3 world X position of a bone.",
|
||||||
"translated-name": "BoneWorldX",
|
"translated-name": "BoneWorldX",
|
||||||
|
|||||||
@ -851,6 +851,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"bone-length": {
|
||||||
|
"description": "获取骨骼的长度。",
|
||||||
|
"translated-name": "BoneLength",
|
||||||
|
"params": {
|
||||||
|
"bone-name": {
|
||||||
|
"name": "骨骼名称",
|
||||||
|
"desc": "骨骼的名称"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"bone-world-x": {
|
"bone-world-x": {
|
||||||
"description": "获取骨骼的C3世界X位置。",
|
"description": "获取骨骼的C3世界X位置。",
|
||||||
"translated-name": "BoneWorldX",
|
"translated-name": "BoneWorldX",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user