mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Add link property for animation selection (dummy).
This commit is contained in:
parent
7dd315e2dd
commit
bab3bf625c
@ -561,6 +561,10 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase {
|
||||
if (!spriteType) await project.CreateObjectType("Sprite", collisionSpriteName);
|
||||
}
|
||||
|
||||
public async selectAnimation () {
|
||||
console.log('[Spine] Select animation dialog called');
|
||||
}
|
||||
|
||||
private lang (stringKey: string, interpolate: (string | number)[] = []): string {
|
||||
const pluginContext = "plugins.esotericsoftware_spineconstruct3.custom_ui.";
|
||||
let intlString = globalThis.lang(`${pluginContext}${stringKey}`);
|
||||
|
||||
@ -22,6 +22,11 @@
|
||||
"name": "Loader scale",
|
||||
"desc": "Loader scale"
|
||||
},
|
||||
"select-animation": {
|
||||
"name": "Select animation",
|
||||
"desc": "Open a dialog to select an animation from the skeleton",
|
||||
"link-text": "Select"
|
||||
},
|
||||
"spine-animation": {
|
||||
"name": "animation",
|
||||
"desc": "animation"
|
||||
|
||||
@ -22,6 +22,11 @@
|
||||
"name": "加载比例",
|
||||
"desc": "加载比例"
|
||||
},
|
||||
"select-animation": {
|
||||
"name": "选择动画",
|
||||
"desc": "打开对话框从骨架中选择动画",
|
||||
"link-text": "选择"
|
||||
},
|
||||
"spine-animation": {
|
||||
"name": "动画",
|
||||
"desc": "动画"
|
||||
|
||||
@ -79,6 +79,13 @@ const PLUGIN_CLASS = class SpineC3Plugin extends SDK.IPluginBase {
|
||||
new SDK.PluginProperty("projectfile", SpineC3Plugin.PROP_SKELETON, { initialValue: "", filter: ".json,.skel" }),
|
||||
new SDK.PluginProperty("float", SpineC3Plugin.PROP_LOADER_SCALE, 1),
|
||||
new SDK.PluginProperty("text", SpineC3Plugin.PROP_SKIN, ""),
|
||||
new SDK.PluginProperty("link", "select-animation", {
|
||||
linkCallback: async (instance) => {
|
||||
const sdkInst = instance as SDKEditorInstanceClass;
|
||||
await sdkInst.selectAnimation();
|
||||
},
|
||||
callbackType: "for-each-instance"
|
||||
}),
|
||||
new SDK.PluginProperty("text", SpineC3Plugin.PROP_ANIMATION, ""),
|
||||
new SDK.PluginProperty("check", SpineC3Plugin.PROP_DEBUG_SKELETON, false),
|
||||
new SDK.PluginProperty("check", SpineC3Plugin.PROP_ENABLE_COLLISION, false),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user