ソースを参照

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

Harald Csaszar 2 年 前
コミット
19d627592d

+ 6 - 0
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs

@@ -310,6 +310,12 @@ namespace Spine.Unity.Editor {
 			if (oldAnimationState != null) {
 			if (oldAnimationState != null) {
 				stateComponent.AnimationState.AssignEventSubscribersFrom(oldAnimationState);
 				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
 #if BUILT_IN_SPRITE_MASK_COMPONENT
 			SpineMaskUtilities.EditorAssignSpriteMaskMaterials(component);
 			SpineMaskUtilities.EditorAssignSpriteMaskMaterials(component);

+ 1 - 1
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineMaskUtilities.cs

@@ -176,7 +176,7 @@ namespace Spine.Unity.Editor {
 			Material[] currentMaterials = meshRenderer.sharedMaterials;
 			Material[] currentMaterials = meshRenderer.sharedMaterials;
 
 
 			if (currentMaterials.Length == 0 || currentMaterials[0] == null) {
 			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;
 				return false;
 			}
 			}
 
 

+ 1 - 1
spine-unity/Assets/Spine/package.json

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