From b8a8df486dc6b602b2b1d9af0b78ef911cda8863 Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 27 Nov 2018 12:09:07 +0100 Subject: [PATCH 1/4] [ts][player] Added iframe tests. --- spine-ts/widget/example/iframe-local.html | 29 +++++++++++++++++++++++ spine-ts/widget/example/iframe-test.html | 29 +++++++++++++++++++++++ spine-ts/widget/example/iframe.html | 29 +++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 spine-ts/widget/example/iframe-local.html create mode 100644 spine-ts/widget/example/iframe-test.html create mode 100644 spine-ts/widget/example/iframe.html diff --git a/spine-ts/widget/example/iframe-local.html b/spine-ts/widget/example/iframe-local.html new file mode 100644 index 000000000..1f470102d --- /dev/null +++ b/spine-ts/widget/example/iframe-local.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + +
+ + + + \ No newline at end of file diff --git a/spine-ts/widget/example/iframe-test.html b/spine-ts/widget/example/iframe-test.html new file mode 100644 index 000000000..93dcb4ae7 --- /dev/null +++ b/spine-ts/widget/example/iframe-test.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spine-ts/widget/example/iframe.html b/spine-ts/widget/example/iframe.html new file mode 100644 index 000000000..b205f2f5a --- /dev/null +++ b/spine-ts/widget/example/iframe.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + +
+ + + + \ No newline at end of file From 7175cf98e71fad4e739e5c092b3afdf0da26ea2e Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 27 Nov 2018 12:24:15 +0100 Subject: [PATCH 2/4] [c][cpp] Closes #1213, don't trim end of atlas file line. --- spine-c/spine-c/src/spine/Atlas.c | 4 ++-- spine-cpp/spine-cpp/src/spine/Atlas.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-c/spine-c/src/spine/Atlas.c b/spine-c/spine-c/src/spine/Atlas.c index 92437633f..11ceb7d85 100644 --- a/spine-c/spine-c/src/spine/Atlas.c +++ b/spine-c/spine-c/src/spine/Atlas.c @@ -70,8 +70,8 @@ static void trim(Str* str) { (str->begin)++; if (str->begin == str->end) return; str->end--; - while (isspace((unsigned char)*str->end) && str->end >= str->begin) - str->end--; + /*while (isspace((unsigned char)*str->end) && str->end >= str->begin) + str->end--;*/ str->end++; } diff --git a/spine-cpp/spine-cpp/src/spine/Atlas.cpp b/spine-cpp/spine-cpp/src/spine/Atlas.cpp index 6b6595493..53c69e981 100644 --- a/spine-cpp/spine-cpp/src/spine/Atlas.cpp +++ b/spine-cpp/spine-cpp/src/spine/Atlas.cpp @@ -249,9 +249,9 @@ void Atlas::trim(Str *str) { str->end--; - while (isspace((unsigned char) *str->end) && str->end >= str->begin) { + /*while (isspace((unsigned char) *str->end) && str->end >= str->begin) { str->end--; - } + }*/ str->end++; } From 80272fb7191c593f1b6cb35f4177d8c9d496d630 Mon Sep 17 00:00:00 2001 From: pharan Date: Wed, 28 Nov 2018 20:53:16 +0800 Subject: [PATCH 3/4] [unity] 2018.3 prefab handling for scene components and inspectors. --- .../Editor/spine-unity/Editor/SkeletonDebugWindow.cs | 10 ++++++++++ .../spine-unity/Editor/SkeletonRendererInspector.cs | 8 ++++++++ .../Editor/BoundingBoxFollowerInspector.cs | 10 ++++++++++ .../Editor/SkeletonUtilityInspector.cs | 12 +++++++++++- 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonDebugWindow.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonDebugWindow.cs index 604619bdc..f32650ae3 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonDebugWindow.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonDebugWindow.cs @@ -30,6 +30,12 @@ // With contributions from: Mitch Thompson +#if UNITY_2018_3 || UNITY_2019 +#define NEW_PREFAB_SYSTEM +#else +#define NO_PREFAB_MESH +#endif + using System.Collections.Generic; using UnityEngine; using UnityEditor; @@ -122,7 +128,11 @@ namespace Spine.Unity.Editor { skeletonRenderer.Initialize(false); skeletonRenderer.LateUpdate(); skeleton = skeletonRenderer.skeleton; +#if NEW_PREFAB_SYSTEM + isPrefab = false; +#else isPrefab |= PrefabUtility.GetPrefabType(selectedObject) == PrefabType.Prefab; +#endif UpdateAttachments(); } } diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonRendererInspector.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonRendererInspector.cs index 1750fa54d..d36fa14a8 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonRendererInspector.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SkeletonRendererInspector.cs @@ -28,7 +28,11 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +#if UNITY_2018_3 || UNITY_2019 +#define NEW_PREFAB_SYSTEM +#else #define NO_PREFAB_MESH +#endif using UnityEditor; using System.Collections.Generic; @@ -81,7 +85,11 @@ namespace Spine.Unity.Editor { } protected virtual void OnEnable () { +#if NEW_PREFAB_SYSTEM + isInspectingPrefab = false; +#else isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab); +#endif SpineEditorUtilities.ConfirmInitialization(); diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs index 94f1e3536..cc1ea35e1 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs @@ -28,6 +28,10 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +#if UNITY_2018_3 || UNITY_2019 +#define NEW_PREFAB_SYSTEM +#endif + using UnityEngine; using UnityEditor; @@ -61,7 +65,11 @@ namespace Spine.Unity.Editor { } public override void OnInspectorGUI () { + #if !NEW_PREFAB_SYSTEM bool isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab); + #else + bool isInspectingPrefab = false; + #endif // Try to auto-assign SkeletonRenderer field. if (skeletonRenderer.objectReferenceValue == null) { @@ -94,8 +102,10 @@ namespace Spine.Unity.Editor { EditorGUILayout.PropertyField(slotName, new GUIContent("Slot")); if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); + #if !NEW_PREFAB_SYSTEM if (!isInspectingPrefab) rebuildRequired = true; + #endif } using (new SpineInspectorUtility.LabelWidthScope(150f)) { diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs b/spine-unity/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs index 5734a7a7c..1b2a2eedc 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs @@ -28,7 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -// Contributed by: Mitch Thompson +#if UNITY_2018_3 || UNITY_2019 +#define NEW_PREFAB_SYSTEM +#endif using UnityEngine; using UnityEditor; @@ -46,7 +48,11 @@ namespace Spine.Unity.Editor { SkeletonUtility skeletonUtility; Skeleton skeleton; SkeletonRenderer skeletonRenderer; + + #if !NEW_PREFAB_SYSTEM bool isPrefab; + #endif + readonly GUIContent SpawnHierarchyButtonLabel = new GUIContent("Spawn Hierarchy", Icons.skeleton); void OnEnable () { @@ -62,14 +68,18 @@ namespace Spine.Unity.Editor { if (!skeletonRenderer.valid) return; + #if !NEW_PREFAB_SYSTEM isPrefab |= PrefabUtility.GetPrefabType(this.target) == PrefabType.Prefab; + #endif } public override void OnInspectorGUI () { + #if !NEW_PREFAB_SYSTEM if (isPrefab) { GUILayout.Label(new GUIContent("Cannot edit Prefabs", Icons.warning)); return; } + #endif if (!skeletonRenderer.valid) { GUILayout.Label(new GUIContent("Spine Component invalid. Check Skeleton Data Asset.", Icons.warning)); From 5530805a3eae5ae52cd6c291c216fc3c7b2fc583 Mon Sep 17 00:00:00 2001 From: pharan Date: Wed, 28 Nov 2018 23:26:45 +0800 Subject: [PATCH 4/4] [csharp] Fix ColorTimeline.Apply before first key. --- spine-csharp/src/Animation.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-csharp/src/Animation.cs b/spine-csharp/src/Animation.cs index e0398e664..b2c21bbf3 100644 --- a/spine-csharp/src/Animation.cs +++ b/spine-csharp/src/Animation.cs @@ -633,10 +633,10 @@ namespace Spine { slot.a = slotData.a; return; case MixBlend.First: - slot.r += (slot.r - slotData.r) * alpha; - slot.g += (slot.g - slotData.g) * alpha; - slot.b += (slot.b - slotData.b) * alpha; - slot.a += (slot.a - slotData.a) * alpha; + slot.r += (slotData.r - slot.r) * alpha; + slot.g += (slotData.g - slot.g) * alpha; + slot.b += (slotData.b - slot.b) * alpha; + slot.a += (slotData.a - slot.a) * alpha; return; } return;