Explorar o código

Merge branch 'master' of https://github.com/esotericsoftware/spine-runtimes

badlogic %!s(int64=9) %!d(string=hai) anos
pai
achega
973a078c1c

+ 1 - 1
spine-unity/Assets/Examples/Scripts/SpineboyPole.cs

@@ -8,7 +8,7 @@ public class SpineboyPole : MonoBehaviour {
 	public SkeletonAnimation skeletonAnimation;
 	public SkeletonRenderSeparator separator;
 
-	[Space]
+	[Space(18)]
 	[SpineAnimation]
 	public string run;
 	[SpineAnimation]

+ 5 - 0
spine-unity/Assets/spine-unity/Asset Types/SkeletonDataAsset.cs

@@ -161,6 +161,11 @@ namespace Spine.Unity {
 				return;
 
 			stateData.DefaultMix = defaultMix;
+
+			// For compatibility with runtime-instantiated SkeletonDataAsset.
+			if (fromAnimation == null || toAnimation == null)
+				return;
+
 			for (int i = 0, n = fromAnimation.Length; i < n; i++) {
 				if (fromAnimation[i].Length == 0 || toAnimation[i].Length == 0)
 					continue;

+ 1 - 1
spine-unity/Assets/spine-unity/Editor/BoneFollowerInspector.cs

@@ -64,8 +64,8 @@ namespace Spine.Unity.Editor {
 			if (skeletonRenderer.objectReferenceValue == null) {
 				SkeletonRenderer parentRenderer = BoneFollowerInspector.GetInParent<SkeletonRenderer>(targetBoneFollower.transform);
 				if (parentRenderer != null && parentRenderer.gameObject != targetBoneFollower.gameObject) {
-					Debug.Log("Inspector automatically assigned BoneFollower.SkeletonRenderer");
 					skeletonRenderer.objectReferenceValue = parentRenderer;
+					Debug.Log("Inspector automatically assigned BoneFollower.SkeletonRenderer");
 				}
 			}
 

+ 5 - 1
spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs

@@ -260,7 +260,11 @@ namespace Spine.Unity.Editor {
 				EditorPrefs.SetFloat(DEFAULT_SCALE_KEY, defaultScale);
 
 			EditorGUI.BeginChangeCheck();
-			defaultShader = EditorGUILayout.DelayedTextField(new GUIContent("Default shader", "Default shader for materials auto-generated on import."), defaultShader);
+			#if UNITY_5_3_OR_NEWER
+			defaultShader = EditorGUILayout.DelayedTextField(new GUIContent("Default shader", "Default shader for materials auto-generated on import."), defaultShader); 
+			#else
+			defaultShader = EditorGUILayout.TextField(new GUIContent("Default shader", "Default shader for materials auto-generated on import."), defaultShader); 
+			#endif
 			if (EditorGUI.EndChangeCheck())
 				EditorPrefs.SetString(DEFAULT_SHADER_KEY, defaultShader);
 			

+ 1 - 1
spine-unity/Assets/spine-unity/Modules/Ragdoll/SkeletonRagdoll.cs

@@ -24,7 +24,7 @@ namespace Spine.Unity.Modules {
 		[Tooltip("Warning!  You will have to re-enable and tune mix values manually if attempting to remove the ragdoll system.")]
 		public bool disableIK = true;
 		public bool disableOtherConstraints = false;
-		[Space]
+		[Space(18)]
 		[Tooltip("Set RootRigidbody IsKinematic to true when Apply is called.")]
 		public bool pinStartBone;
 		[Tooltip("Enable Collision between adjacent ragdoll elements (IE: Neck and Head)")]

+ 14 - 0
spine-unity/Assets/spine-unity/SkeletonAnimation.cs

@@ -45,16 +45,30 @@ namespace Spine.Unity {
 		public Spine.AnimationState state;
 		public Spine.AnimationState AnimationState { get { return this.state; } }
 
+		/// <summary>
+		/// Occurs after the animations are applied and before world space values are resolved.
+		/// Use this callback when you want to set bone local values.
+		/// </summary>
 		public event UpdateBonesDelegate UpdateLocal {
 			add { _UpdateLocal += value; }
 			remove { _UpdateLocal -= value; }
 		}
 
+		/// <summary>
+		/// Occurs after the Skeleton's bone world space values are resolved (including all constraints).
+		/// Using this callback will cause the world space values to be solved an extra time.
+		/// Use this callback if want to use bone world space values, and also set bone local values.
+		/// </summary>
 		public event UpdateBonesDelegate UpdateWorld {
 			add { _UpdateWorld += value; }
 			remove { _UpdateWorld -= value; }
 		}
 
+		/// <summary>
+		/// Occurs after the Skeleton's bone world space values are resolved (including all constraints).
+		/// Use this callback if you want to use bone world space values, but don't intend to modify bone local values.
+		/// This callback can also be used when setting world position and the bone matrix.
+		/// </summary>
 		public event UpdateBonesDelegate UpdateComplete {
 			add { _UpdateComplete += value; }
 			remove { _UpdateComplete -= value; }

+ 14 - 0
spine-unity/Assets/spine-unity/SkeletonAnimator.cs

@@ -14,16 +14,30 @@ namespace Spine.Unity {
 		public enum MixMode { AlwaysMix, MixNext, SpineStyle }
 		public MixMode[] layerMixModes = new MixMode[0];
 
+		/// <summary>
+		/// Occurs after the animations are applied and before world space values are resolved.
+		/// Use this callback when you want to set bone local values.
+		/// </summary>
 		public event UpdateBonesDelegate UpdateLocal {
 			add { _UpdateLocal += value; }
 			remove { _UpdateLocal -= value; }
 		}
 
+		/// <summary>
+		/// Occurs after the Skeleton's bone world space values are resolved (including all constraints).
+		/// Using this callback will cause the world space values to be solved an extra time.
+		/// Use this callback if want to use bone world space values, and also set bone local values.
+		/// </summary>
 		public event UpdateBonesDelegate UpdateWorld {
 			add { _UpdateWorld += value; }
 			remove { _UpdateWorld -= value; }
 		}
 
+		/// <summary>
+		/// Occurs after the Skeleton's bone world space values are resolved (including all constraints).
+		/// Use this callback if you want to use bone world space values, but don't intend to modify bone local values.
+		/// This callback can also be used when setting world position and the bone matrix.
+		/// </summary>
 		public event UpdateBonesDelegate UpdateComplete {
 			add { _UpdateComplete += value; }
 			remove { _UpdateComplete -= value; }

+ 4 - 9
spine-unity/Assets/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs

@@ -12,7 +12,6 @@ using UnityEditor;
 #else
 using UnityEditor.AnimatedValues;
 #endif
-using System.Collections;
 using System.Collections.Generic;
 using Spine;
 
@@ -111,12 +110,8 @@ namespace Spine.Unity.Editor {
 
 		void UpdateAttachments () {
 			attachmentTable = new Dictionary<Slot, List<Attachment>>();
-			Skin skin = skeleton.Skin;
-
-			if (skin == null) {
-				skin = skeletonRenderer.skeletonDataAsset.GetSkeletonData(true).DefaultSkin;
-			}
 
+			Skin skin = skeleton.Skin ?? skeletonRenderer.skeletonDataAsset.GetSkeletonData(true).DefaultSkin;
 			for (int i = skeleton.Slots.Count-1; i >= 0; i--) {
 				List<Attachment> attachments = new List<Attachment>();
 				skin.FindAttachmentsForSlot(i, attachments);
@@ -229,14 +224,14 @@ namespace Spine.Unity.Editor {
 						GUI.contentColor = Color.white;
 					}
 				}
-				#if UNITY_4_3
+			#if UNITY_4_3
 
-				#else
+			#else
 			}
 			EditorGUILayout.EndFadeGroup();
 			if (showSlots.isAnimating)
 				Repaint();
-				#endif
+			#endif
 		}
 
 		void SpawnHierarchyContextMenu () {