mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Add expression current-skin.
This commit is contained in:
parent
0c189465c7
commit
6af077c0a6
@ -379,6 +379,12 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "current-skin",
|
||||||
|
"expressionName": "CurrentSkin",
|
||||||
|
"highlight": false,
|
||||||
|
"returnType": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,10 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Exps =
|
|||||||
|
|
||||||
BoneRotation (this: SDKInstanceClass, boneName: string) {
|
BoneRotation (this: SDKInstanceClass, boneName: string) {
|
||||||
return this.getBoneRotation(boneName);
|
return this.getBoneRotation(boneName);
|
||||||
|
},
|
||||||
|
|
||||||
|
CurrentSkin (this: SDKInstanceClass) {
|
||||||
|
return this.getCurrentSkin();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -426,6 +426,15 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
|
|||||||
return boneRotation + (offsetAngle * 180 / Math.PI);
|
return boneRotation + (offsetAngle * 180 / Math.PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getCurrentSkin (): string {
|
||||||
|
if (!this.skeleton) return "";
|
||||||
|
|
||||||
|
const skin = this.skeleton.skin;
|
||||||
|
if (!skin) return "";
|
||||||
|
|
||||||
|
return skin.name;
|
||||||
|
}
|
||||||
|
|
||||||
private _setSkin () {
|
private _setSkin () {
|
||||||
const { skeleton } = this;
|
const { skeleton } = this;
|
||||||
if (!skeleton) return;
|
if (!skeleton) return;
|
||||||
|
|||||||
@ -456,6 +456,10 @@
|
|||||||
"desc": "Name of the bone"
|
"desc": "Name of the bone"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"current-skin": {
|
||||||
|
"description": "Get the current skin name. Returns comma-separated names if multiple skins are active.",
|
||||||
|
"translated-name": "CurrentSkin"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -456,6 +456,10 @@
|
|||||||
"desc": "骨骼的名称"
|
"desc": "骨骼的名称"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"current-skin": {
|
||||||
|
"description": "获取当前皮肤名称。如果有多个皮肤处于活动状态,返回逗号分隔的名称。",
|
||||||
|
"translated-name": "CurrentSkin"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user