Add expression current-skin.

This commit is contained in:
Davide Tantillo 2025-11-07 10:50:16 +01:00
parent 0c189465c7
commit 6af077c0a6
5 changed files with 27 additions and 0 deletions

View File

@ -379,6 +379,12 @@
"type": "string"
}
]
},
{
"id": "current-skin",
"expressionName": "CurrentSkin",
"highlight": false,
"returnType": "string"
}
]
}

View File

@ -27,6 +27,10 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Exps =
BoneRotation (this: SDKInstanceClass, boneName: string) {
return this.getBoneRotation(boneName);
},
CurrentSkin (this: SDKInstanceClass) {
return this.getCurrentSkin();
}
};

View File

@ -426,6 +426,15 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
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 () {
const { skeleton } = this;
if (!skeleton) return;

View File

@ -456,6 +456,10 @@
"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"
}
}
}

View File

@ -456,6 +456,10 @@
"desc": "骨骼的名称"
}
}
},
"current-skin": {
"description": "获取当前皮肤名称。如果有多个皮肤处于活动状态,返回逗号分隔的名称。",
"translated-name": "CurrentSkin"
}
}
}