mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '3.7-beta' into 3.7-beta-cpp
This commit is contained in:
commit
6cf1d1fb30
@ -70,8 +70,8 @@ static void trim(Str* str) {
|
|||||||
(str->begin)++;
|
(str->begin)++;
|
||||||
if (str->begin == str->end) return;
|
if (str->begin == str->end) return;
|
||||||
str->end--;
|
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--;*/
|
||||||
str->end++;
|
str->end++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -249,9 +249,9 @@ void Atlas::trim(Str *str) {
|
|||||||
|
|
||||||
str->end--;
|
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--;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
str->end++;
|
str->end++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -633,10 +633,10 @@ namespace Spine {
|
|||||||
slot.a = slotData.a;
|
slot.a = slotData.a;
|
||||||
return;
|
return;
|
||||||
case MixBlend.First:
|
case MixBlend.First:
|
||||||
slot.r += (slot.r - slotData.r) * alpha;
|
slot.r += (slotData.r - slot.r) * alpha;
|
||||||
slot.g += (slot.g - slotData.g) * alpha;
|
slot.g += (slotData.g - slot.g) * alpha;
|
||||||
slot.b += (slot.b - slotData.b) * alpha;
|
slot.b += (slotData.b - slot.b) * alpha;
|
||||||
slot.a += (slot.a - slotData.a) * alpha;
|
slot.a += (slotData.a - slot.a) * alpha;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
29
spine-ts/widget/example/iframe-local.html
Normal file
29
spine-ts/widget/example/iframe-local.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script src="../../build/spine-widget.js"></script>
|
||||||
|
<link rel="stylesheet" href="../css/spine-player.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="player"></div>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
window.addEventListener("message", function (event) {
|
||||||
|
new spine.SpinePlayer(document.getElementById("player"), event.data);
|
||||||
|
}, false);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
29
spine-ts/widget/example/iframe-test.html
Normal file
29
spine-ts/widget/example/iframe-test.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
iframe {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<!--<iframe id="player" src="http://esotericsoftware.com/spine-player/3.7/iframe.html" width="600" height="480"></iframe>-->
|
||||||
|
<iframe id="player" src="http://localhost:8000/widget/example/iframe-local.html" width="600" height="480"></iframe>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
var player = document.getElementById("player");
|
||||||
|
var playerConfig = {
|
||||||
|
atlasUrl: "http://esotericsoftware.com/files/examples/spineboy/export/spineboy-pma.atlas",
|
||||||
|
jsonUrl: "http://esotericsoftware.com/files/examples/spineboy/export/spineboy-pro.json",
|
||||||
|
premultipliedAlpha: true
|
||||||
|
};
|
||||||
|
player.addEventListener("load", function () {
|
||||||
|
player.contentWindow.postMessage(playerConfig, "*");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
29
spine-ts/widget/example/iframe.html
Normal file
29
spine-ts/widget/example/iframe.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script src="./spine-widget.js"></script>
|
||||||
|
<link rel="stylesheet" href="./spine-player.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="player"></div>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
window.addEventListener("message", function (event) {
|
||||||
|
new spine.SpinePlayer(document.getElementById("player"), event.data);
|
||||||
|
}, false);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -30,6 +30,12 @@
|
|||||||
|
|
||||||
// With contributions from: Mitch Thompson
|
// 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 System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
@ -122,7 +128,11 @@ namespace Spine.Unity.Editor {
|
|||||||
skeletonRenderer.Initialize(false);
|
skeletonRenderer.Initialize(false);
|
||||||
skeletonRenderer.LateUpdate();
|
skeletonRenderer.LateUpdate();
|
||||||
skeleton = skeletonRenderer.skeleton;
|
skeleton = skeletonRenderer.skeleton;
|
||||||
|
#if NEW_PREFAB_SYSTEM
|
||||||
|
isPrefab = false;
|
||||||
|
#else
|
||||||
isPrefab |= PrefabUtility.GetPrefabType(selectedObject) == PrefabType.Prefab;
|
isPrefab |= PrefabUtility.GetPrefabType(selectedObject) == PrefabType.Prefab;
|
||||||
|
#endif
|
||||||
UpdateAttachments();
|
UpdateAttachments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,11 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#if UNITY_2018_3 || UNITY_2019
|
||||||
|
#define NEW_PREFAB_SYSTEM
|
||||||
|
#else
|
||||||
#define NO_PREFAB_MESH
|
#define NO_PREFAB_MESH
|
||||||
|
#endif
|
||||||
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -81,7 +85,11 @@ namespace Spine.Unity.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnEnable () {
|
protected virtual void OnEnable () {
|
||||||
|
#if NEW_PREFAB_SYSTEM
|
||||||
|
isInspectingPrefab = false;
|
||||||
|
#else
|
||||||
isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
|
isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
|
||||||
|
#endif
|
||||||
|
|
||||||
SpineEditorUtilities.ConfirmInitialization();
|
SpineEditorUtilities.ConfirmInitialization();
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#if UNITY_2018_3 || UNITY_2019
|
||||||
|
#define NEW_PREFAB_SYSTEM
|
||||||
|
#endif
|
||||||
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
|
|
||||||
@ -61,7 +65,11 @@ namespace Spine.Unity.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void OnInspectorGUI () {
|
public override void OnInspectorGUI () {
|
||||||
|
#if !NEW_PREFAB_SYSTEM
|
||||||
bool isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
|
bool isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
|
||||||
|
#else
|
||||||
|
bool isInspectingPrefab = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Try to auto-assign SkeletonRenderer field.
|
// Try to auto-assign SkeletonRenderer field.
|
||||||
if (skeletonRenderer.objectReferenceValue == null) {
|
if (skeletonRenderer.objectReferenceValue == null) {
|
||||||
@ -94,8 +102,10 @@ namespace Spine.Unity.Editor {
|
|||||||
EditorGUILayout.PropertyField(slotName, new GUIContent("Slot"));
|
EditorGUILayout.PropertyField(slotName, new GUIContent("Slot"));
|
||||||
if (EditorGUI.EndChangeCheck()) {
|
if (EditorGUI.EndChangeCheck()) {
|
||||||
serializedObject.ApplyModifiedProperties();
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
#if !NEW_PREFAB_SYSTEM
|
||||||
if (!isInspectingPrefab)
|
if (!isInspectingPrefab)
|
||||||
rebuildRequired = true;
|
rebuildRequired = true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
using (new SpineInspectorUtility.LabelWidthScope(150f)) {
|
using (new SpineInspectorUtility.LabelWidthScope(150f)) {
|
||||||
|
|||||||
@ -28,7 +28,9 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
// Contributed by: Mitch Thompson
|
#if UNITY_2018_3 || UNITY_2019
|
||||||
|
#define NEW_PREFAB_SYSTEM
|
||||||
|
#endif
|
||||||
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
@ -46,7 +48,11 @@ namespace Spine.Unity.Editor {
|
|||||||
SkeletonUtility skeletonUtility;
|
SkeletonUtility skeletonUtility;
|
||||||
Skeleton skeleton;
|
Skeleton skeleton;
|
||||||
SkeletonRenderer skeletonRenderer;
|
SkeletonRenderer skeletonRenderer;
|
||||||
|
|
||||||
|
#if !NEW_PREFAB_SYSTEM
|
||||||
bool isPrefab;
|
bool isPrefab;
|
||||||
|
#endif
|
||||||
|
|
||||||
readonly GUIContent SpawnHierarchyButtonLabel = new GUIContent("Spawn Hierarchy", Icons.skeleton);
|
readonly GUIContent SpawnHierarchyButtonLabel = new GUIContent("Spawn Hierarchy", Icons.skeleton);
|
||||||
|
|
||||||
void OnEnable () {
|
void OnEnable () {
|
||||||
@ -62,14 +68,18 @@ namespace Spine.Unity.Editor {
|
|||||||
|
|
||||||
if (!skeletonRenderer.valid) return;
|
if (!skeletonRenderer.valid) return;
|
||||||
|
|
||||||
|
#if !NEW_PREFAB_SYSTEM
|
||||||
isPrefab |= PrefabUtility.GetPrefabType(this.target) == PrefabType.Prefab;
|
isPrefab |= PrefabUtility.GetPrefabType(this.target) == PrefabType.Prefab;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnInspectorGUI () {
|
public override void OnInspectorGUI () {
|
||||||
|
#if !NEW_PREFAB_SYSTEM
|
||||||
if (isPrefab) {
|
if (isPrefab) {
|
||||||
GUILayout.Label(new GUIContent("Cannot edit Prefabs", Icons.warning));
|
GUILayout.Label(new GUIContent("Cannot edit Prefabs", Icons.warning));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!skeletonRenderer.valid) {
|
if (!skeletonRenderer.valid) {
|
||||||
GUILayout.Label(new GUIContent("Spine Component invalid. Check Skeleton Data Asset.", Icons.warning));
|
GUILayout.Label(new GUIContent("Spine Component invalid. Check Skeleton Data Asset.", Icons.warning));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user