mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
Animation error in editor.
This commit is contained in:
parent
f8c82e0fb9
commit
a64ec68c3f
@ -79,6 +79,7 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase {
|
||||
|
||||
const hasErrors = this.hasErrors();
|
||||
if (this.skeleton && !hasErrors) {
|
||||
this.setAnimation();
|
||||
this.setSkin();
|
||||
|
||||
const rectX = this._inst.GetX();
|
||||
@ -233,6 +234,7 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase {
|
||||
}
|
||||
|
||||
if (id === PLUGIN_CLASS.PROP_ANIMATION) {
|
||||
this.setAnimation();
|
||||
this.layoutView?.Refresh();
|
||||
return;
|
||||
}
|
||||
@ -262,6 +264,10 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase {
|
||||
console.log("Prop change end");
|
||||
}
|
||||
|
||||
private setAnimation () {
|
||||
this.animation = this._inst.GetPropertyValue(PLUGIN_CLASS.PROP_ANIMATION) as string;
|
||||
}
|
||||
|
||||
private setSkin () {
|
||||
const { skeleton } = this;
|
||||
if (!skeleton) return;
|
||||
@ -426,6 +432,12 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase {
|
||||
"Animation/Skin bounds provider requires one between skin and animation to be set."
|
||||
);
|
||||
|
||||
this.setError(
|
||||
"nonExistingAnimation",
|
||||
Boolean(!animation || this.skeleton?.data.findAnimation(animation)) === false,
|
||||
"Not existing animation"
|
||||
);
|
||||
|
||||
const { width, height } = spineBounds;
|
||||
this.setError(
|
||||
"boundsNoDimension",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user