From cc89e1a3a6ea9485e7e156d06dede66eed0624d2 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Thu, 8 May 2014 12:02:34 +0200 Subject: [PATCH 1/3] Fixed Skeleton#setAttachment. closes #215 --- spine-js/spine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-js/spine.js b/spine-js/spine.js index 4330330fb..5c8fd5307 100644 --- a/spine-js/spine.js +++ b/spine-js/spine.js @@ -776,7 +776,7 @@ spine.Skeleton.prototype = { if (slot.data.name == slotName) { var attachment = null; if (attachmentName) { - attachment = this.getAttachment(i, attachmentName); + attachment = this.getAttachmentBySlotIndex(i, attachmentName); if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; } slot.setAttachment(attachment); From 9c403565e0cd473358a5b63fe8d4ff99d629ceae Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Thu, 8 May 2014 12:11:26 +0200 Subject: [PATCH 2/3] Fixed timeScale bug. Added timeScale to inspector. --- spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs | 1 + spine-tk2d/Assets/Spine/SkeletonAnimation.cs | 2 +- spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs | 1 + spine-unity/Assets/Spine/SkeletonAnimation.cs | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs b/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs index 1574b3cdc..a47c38f68 100644 --- a/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs +++ b/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs @@ -72,5 +72,6 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { } EditorGUILayout.PropertyField(loop); + EditorGUILayout.PropertyField(timeScale); } } diff --git a/spine-tk2d/Assets/Spine/SkeletonAnimation.cs b/spine-tk2d/Assets/Spine/SkeletonAnimation.cs index cb490af27..8810a5383 100644 --- a/spine-tk2d/Assets/Spine/SkeletonAnimation.cs +++ b/spine-tk2d/Assets/Spine/SkeletonAnimation.cs @@ -81,7 +81,7 @@ public class SkeletonAnimation : SkeletonRenderer { deltaTime *= timeScale; skeleton.Update(deltaTime); - state.Update(deltaTime * timeScale); + state.Update(deltaTime); state.Apply(skeleton); if (UpdateBones != null) UpdateBones(this); skeleton.UpdateWorldTransform(); diff --git a/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs b/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs index 1574b3cdc..a47c38f68 100644 --- a/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs +++ b/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs @@ -72,5 +72,6 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { } EditorGUILayout.PropertyField(loop); + EditorGUILayout.PropertyField(timeScale); } } diff --git a/spine-unity/Assets/Spine/SkeletonAnimation.cs b/spine-unity/Assets/Spine/SkeletonAnimation.cs index cb490af27..8810a5383 100644 --- a/spine-unity/Assets/Spine/SkeletonAnimation.cs +++ b/spine-unity/Assets/Spine/SkeletonAnimation.cs @@ -81,7 +81,7 @@ public class SkeletonAnimation : SkeletonRenderer { deltaTime *= timeScale; skeleton.Update(deltaTime); - state.Update(deltaTime * timeScale); + state.Update(deltaTime); state.Apply(skeleton); if (UpdateBones != null) UpdateBones(this); skeleton.UpdateWorldTransform(); From f597ad5d6a963b86b23f1b7d631166812742f0d9 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Thu, 8 May 2014 12:13:51 +0200 Subject: [PATCH 3/3] timeScale can't be negative. --- spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs | 1 + spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs b/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs index a47c38f68..bc6d6b19c 100644 --- a/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs +++ b/spine-tk2d/Assets/Spine/Editor/SkeletonAnimationInspector.cs @@ -73,5 +73,6 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { EditorGUILayout.PropertyField(loop); EditorGUILayout.PropertyField(timeScale); + component.timeScale = Math.Max(component.timeScale, 0); } } diff --git a/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs b/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs index a47c38f68..bc6d6b19c 100644 --- a/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs +++ b/spine-unity/Assets/Spine/Editor/SkeletonAnimationInspector.cs @@ -73,5 +73,6 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { EditorGUILayout.PropertyField(loop); EditorGUILayout.PropertyField(timeScale); + component.timeScale = Math.Max(component.timeScale, 0); } }