diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java index a0d4cd193..257809d9a 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java @@ -517,12 +517,19 @@ public class AnimationState { } /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's - * {@link TrackEntry#getMixDuration()}. + * {@link TrackEntry#getMixDuration()}. An empty animation has no timelines and serves as a placeholder for mixing in or out. *
- * Mixing out is done by setting an empty animation. A mix duration of 0 still mixes out over one frame. + * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation(int, float)}, + * {@link #setEmptyAnimations(float)}, or {@link #addEmptyAnimation(int, float, float)}. Mixing to an empty animation causes + * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation + * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of + * 0 still mixes out over one frame. *
- * To mix in, first set an empty animation and add an animation using {@link #addAnimation(int, Animation, boolean, float)}, - * then set the {@link TrackEntry#setMixDuration(float)} on the returned track entry. */ + * Mixing in is done by first setting an empty animation, then adding an animation using + * {@link #addAnimation(int, Animation, boolean, float)} and on the returned track entry, set the + * {@link TrackEntry#setMixDuration(float)}. Mixing from an empty animation causes the new animation to be applied more and + * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the + * setup pose value if no lower tracks key the property to the value keyed in the new animation. */ public TrackEntry setEmptyAnimation (int trackIndex, float mixDuration) { TrackEntry entry = setAnimation(trackIndex, emptyAnimation, false); entry.mixDuration = mixDuration; @@ -533,6 +540,8 @@ public class AnimationState { /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's * {@link TrackEntry#getMixDuration()}. If the track is empty, it is equivalent to calling * {@link #setEmptyAnimation(int, float)}. + *
+ * See {@link #setEmptyAnimation(int, float)}.
* @param delay Seconds to begin this animation after the start of the previous animation. May be <= 0 to use the animation
* duration of the previous track minus any mix duration plus delay.
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
@@ -810,8 +819,8 @@ public class AnimationState {
* is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the
* properties keyed by the animation are set to the setup pose and the track is cleared.
*
- * It may be desired to use {@link AnimationState#addEmptyAnimation(int, float, float)} to mix the properties back to the
- * setup pose over time, rather than have it happen instantly. */
+ * It may be desired to use {@link AnimationState#addEmptyAnimation(int, float, float)} rather than have the animation
+ * abruptly cease being applied. */
public float getTrackEnd () {
return trackEnd;
}
diff --git a/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java b/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java
index 2879d27cf..d4c2a51cb 100644
--- a/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java
+++ b/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/SkeletonViewer.java
@@ -811,19 +811,19 @@ public class SkeletonViewer extends ApplicationAdapter {
public boolean touchDown (int screenX, int screenY, int pointer, int button) {
offsetX = screenX;
- offsetY = Gdx.graphics.getHeight() - screenY;
+ offsetY = Gdx.graphics.getHeight() - 1 - screenY;
return false;
}
public boolean touchDragged (int screenX, int screenY, int pointer) {
float deltaX = screenX - offsetX;
- float deltaY = Gdx.graphics.getHeight() - screenY - offsetY;
+ float deltaY = Gdx.graphics.getHeight() - 1 - screenY - offsetY;
camera.position.x -= deltaX * camera.zoom;
camera.position.y -= deltaY * camera.zoom;
offsetX = screenX;
- offsetY = Gdx.graphics.getHeight() - screenY;
+ offsetY = Gdx.graphics.getHeight() - 1 - screenY;
return false;
}
diff --git a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs
index d23a1f614..5c58ff055 100644
--- a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs
+++ b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs
@@ -230,9 +230,16 @@ namespace Spine.Unity.Editor {
EditorApplication.hierarchyWindowItemOnGUI += HierarchyDragAndDrop;
// Hierarchy Icons
+ #if UNITY_2017_2_OR_NEWER
+ EditorApplication.playModeStateChanged -= HierarchyIconsOnPlaymodeStateChanged;
+ EditorApplication.playModeStateChanged += HierarchyIconsOnPlaymodeStateChanged;
+ HierarchyIconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
+ #else
EditorApplication.playmodeStateChanged -= HierarchyIconsOnPlaymodeStateChanged;
EditorApplication.playmodeStateChanged += HierarchyIconsOnPlaymodeStateChanged;
HierarchyIconsOnPlaymodeStateChanged();
+ #endif
+
initialized = true;
}
@@ -255,7 +262,11 @@ namespace Spine.Unity.Editor {
showHierarchyIcons = EditorGUILayout.Toggle(new GUIContent("Show Hierarchy Icons", "Show relevant icons on GameObjects with Spine Components on them. Disable this if you have large, complex scenes."), showHierarchyIcons);
if (EditorGUI.EndChangeCheck()) {
EditorPrefs.SetBool(SHOW_HIERARCHY_ICONS_KEY, showHierarchyIcons);
+ #if UNITY_2017_2_OR_NEWER
+ HierarchyIconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
+ #else
HierarchyIconsOnPlaymodeStateChanged();
+ #endif
}
EditorGUILayout.Separator();
@@ -496,7 +507,11 @@ namespace Spine.Unity.Editor {
#endregion
#region Hierarchy
+ #if UNITY_2017_2_OR_NEWER
+ static void HierarchyIconsOnPlaymodeStateChanged (PlayModeStateChange stateChange) {
+ #else
static void HierarchyIconsOnPlaymodeStateChanged () {
+ #endif
skeletonRendererTable.Clear();
skeletonUtilityBoneTable.Clear();
boundingBoxFollowerTable.Clear();
diff --git a/spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs b/spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs
index 0776572c6..985fcf8fa 100644
--- a/spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs
+++ b/spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs
@@ -113,37 +113,37 @@ namespace Spine.Unity.Modules.AttachmentTools {
#region Runtime RegionAttachments
///