diff --git a/CHANGELOG.md b/CHANGELOG.md index 96d6e859d..5e051f64c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -302,6 +302,7 @@ * Timeline track appearance and Inspector: Tracks now show icons and track colors to make them easier to distinguish. When a Track is selected, the Inspector now shows an editable track name which was previously only editable at the Timeline asset. * Added example component `SkeletonRenderTexture` to render a `SkeletonRenderer` to a `RenderTexture`, mainly for proper transparency. Added an example scene named `RenderTexture FadeOut Transparency` that demonstrates usage for a fadeout transparency effect. * Added another fadeout example component named `SkeletonRenderTextureFadeout` which takes over transparency fadeout when enabled. You can use this component as-is, attach it in disabled state and enable it to start a fadeout effect. + * Timeline clips now offer an additional `Alpha` parameter for setting a custom constant mix alpha value other than 1.0, just as `TrackEntry.Alpha`. Defaults to 1.0. * **Changes of default values** diff --git a/spine-unity/Modules/com.esotericsoftware.spine.timeline/Editor/SpineAnimationStateDrawer.cs b/spine-unity/Modules/com.esotericsoftware.spine.timeline/Editor/SpineAnimationStateDrawer.cs index 7fc823add..1e08c1bb6 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.timeline/Editor/SpineAnimationStateDrawer.cs +++ b/spine-unity/Modules/com.esotericsoftware.spine.timeline/Editor/SpineAnimationStateDrawer.cs @@ -36,7 +36,7 @@ using UnityEngine; public class SpineAnimationStateDrawer : PropertyDrawer { public override float GetPropertyHeight (SerializedProperty property, GUIContent label) { - const int fieldCount = 15; + const int fieldCount = 16; return fieldCount * EditorGUIUtility.singleLineHeight; } @@ -48,6 +48,7 @@ public class SpineAnimationStateDrawer : PropertyDrawer { SerializedProperty useBlendDurationProp = property.FindPropertyRelative("useBlendDuration"); SerializedProperty mixDurationProp = property.FindPropertyRelative("mixDuration"); SerializedProperty holdPreviousProp = property.FindPropertyRelative("holdPrevious"); + SerializedProperty alphaProp = property.FindPropertyRelative("alpha"); SerializedProperty dontPauseWithDirectorProp = property.FindPropertyRelative("dontPauseWithDirector"); SerializedProperty dontEndWithClip = property.FindPropertyRelative("dontEndWithClip"); SerializedProperty endMixOutDuration = property.FindPropertyRelative("endMixOutDuration"); @@ -129,5 +130,8 @@ public class SpineAnimationStateDrawer : PropertyDrawer { singleFieldRect.y += lineHeightWithSpacing; EditorGUI.PropertyField(singleFieldRect, drawOrderProp); + + singleFieldRect.y += lineHeightWithSpacing; + EditorGUI.PropertyField(singleFieldRect, alphaProp); } } diff --git a/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateBehaviour.cs b/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateBehaviour.cs index 0e76688b2..72b9394cc 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateBehaviour.cs +++ b/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateBehaviour.cs @@ -69,6 +69,9 @@ namespace Spine.Unity.Playables { [Range(0, 1f)] public float drawOrderThreshold = 0.5f; + + [Range(0, 1f)] + public float alpha = 1.0f; } } diff --git a/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs b/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs index e489ac2d7..77dd3b983 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs +++ b/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs @@ -193,6 +193,7 @@ namespace Spine.Unity.Playables { trackEntry.TimeScale = clipSpeed * rootSpeed; trackEntry.AttachmentThreshold = clipData.attachmentThreshold; trackEntry.HoldPrevious = clipData.holdPrevious; + trackEntry.Alpha = clipData.alpha; if (clipData.customDuration) trackEntry.MixDuration = customMixDuration / rootSpeed; @@ -289,6 +290,7 @@ namespace Spine.Unity.Playables { if (toAnimation != null) { toEntry = dummyAnimationState.SetAnimation(0, toAnimation, clipData.loop); toEntry.HoldPrevious = clipData.holdPrevious; + toEntry.Alpha = clipData.alpha; } } @@ -304,7 +306,7 @@ namespace Spine.Unity.Playables { dummyAnimationState.Apply(skeleton); } else { if (toAnimation != null) - toAnimation.Apply(skeleton, 0, toClipTime, clipData.loop, null, 1f, MixBlend.Setup, MixDirection.In); + toAnimation.Apply(skeleton, 0, toClipTime, clipData.loop, null, clipData.alpha, MixBlend.Setup, MixDirection.In); } if (skeletonAnimation) { diff --git a/spine-unity/Modules/com.esotericsoftware.spine.timeline/package-no-spine-unity-dependency.json b/spine-unity/Modules/com.esotericsoftware.spine.timeline/package-no-spine-unity-dependency.json index 382e3bb06..56a626bf9 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.timeline/package-no-spine-unity-dependency.json +++ b/spine-unity/Modules/com.esotericsoftware.spine.timeline/package-no-spine-unity-dependency.json @@ -2,7 +2,7 @@ "name": "com.esotericsoftware.spine.timeline", "displayName": "Spine Timeline Extensions", "description": "This plugin provides integration of spine-unity for the Unity Timeline.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime (via the spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)", - "version": "4.1.4", + "version": "4.1.5", "unity": "2018.3", "author": { "name": "Esoteric Software", diff --git a/spine-unity/Modules/com.esotericsoftware.spine.timeline/package.json b/spine-unity/Modules/com.esotericsoftware.spine.timeline/package.json index 842059712..b4332da54 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.timeline/package.json +++ b/spine-unity/Modules/com.esotericsoftware.spine.timeline/package.json @@ -2,7 +2,7 @@ "name": "com.esotericsoftware.spine.timeline", "displayName": "Spine Timeline Extensions", "description": "This plugin provides integration of spine-unity for the Unity Timeline.\n\nPrerequisites:\nIt requires a working installation of the spine-unity and spine-csharp runtimes as UPM packages (not as spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)", - "version": "4.1.4", + "version": "4.1.5", "unity": "2018.3", "author": { "name": "Esoteric Software",