[unity] Fixed mask material generation issuing incorrect warnings when only animation sets visible attachments. Applying initial animation before mask material generation. Closes #2363.

This commit is contained in:
Harald Csaszar 2023-09-12 21:00:28 +02:00
parent 4cc4f15f47
commit 19d627592d
3 changed files with 8 additions and 2 deletions

View File

@ -310,6 +310,12 @@ namespace Spine.Unity.Editor {
if (oldAnimationState != null) {
stateComponent.AnimationState.AssignEventSubscribersFrom(oldAnimationState);
}
if (stateComponent != null) {
// Any set animation needs to be applied as well since it might set attachments,
// having an effect on generated SpriteMaskMaterials below.
stateComponent.AnimationState.Apply(component.skeleton);
component.LateUpdate();
}
#if BUILT_IN_SPRITE_MASK_COMPONENT
SpineMaskUtilities.EditorAssignSpriteMaskMaterials(component);

View File

@ -176,7 +176,7 @@ namespace Spine.Unity.Editor {
Material[] currentMaterials = meshRenderer.sharedMaterials;
if (currentMaterials.Length == 0 || currentMaterials[0] == null) {
Debug.LogWarning("No materials found assigned at " + skeleton.name);
// Note: if no attachments are visible, no materials are set. This is a valid state.
return false;
}

View File

@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.spine-unity",
"displayName": "spine-unity Runtime",
"description": "This plugin provides the spine-unity runtime core.",
"version": "4.1.22",
"version": "4.1.23",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",