Merge branch '4.0' into 4.1-beta

This commit is contained in:
Harald Csaszar 2022-02-07 16:25:34 +01:00
commit 76068cc4f4
30 changed files with 150 additions and 78 deletions

View File

@ -204,7 +204,7 @@
* Fixed Timeline not pausing (and resuming) clip playback on Director pause, this is now the default behaviour. If you require the old behaviour (e.g. to continue playing an idle animation during Director pause), there is now an additional parameter `Don't Pause with Director` provided that can be enabled for each Timeline clip.
* Fixed Timeline `Spine AnimationState Clips` ignoring empty space on the Timeline after a clip's end. Timeline clips now also offer `Don't End with Clip` and `Clip End Mix Out Duration` parameters if you prefer the old behaviour of previous versions. By default when empty space follows the clip on the timeline, the empty animation is set on the track with a MixDuration of `Clip End Mix Out Duration`. Set `Don't End with Clip` to `true` to continue playing the clip's animation instead and mimic the old 3.8 behaviour. If you prefer pausing the animation instead of mixing out to the empty animation, set `Clip End Mix Out Duration` to a value less than 0, then the animation is paused instead.
* **Additions**
* **Additions and Improvements**
* Additional **Fix Draw Order** parameter at SkeletonRenderer, defaults to `disabled` (previous behaviour).
Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. "A B A").
If `true`, MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes
@ -255,6 +255,8 @@
* `BoundingBoxFollower` and `BoundingBoxFollowerGraphic` now provide previously missing `usedByEffector` and `usedByComposite` parameters to be set at all generated colliders.
* `BoneFollower` and `BoneFollowerGraphic` now provide an additional `Follow Parent World Scale` parameter to allow following simple scale of parent bones (rotated/skewed scale can't be supported).
* Improved `Advanced - Fix Prefab Override MeshFilter` property for `SkeletonRenderer` (and subclasses`SkeletonAnimation` and `SkeletonMecanim`), now providing an additional option to use a global value which can be set in `Edit - Preferences - Spine`.
* Timeline naming improvements: `Spine AnimationState Clip` Inspector parameter `Custom Duration` changed and inverted to `Default Mix Duration` for more clarity. Shortened all Timeline add track menu entries from: `Spine.Unity.Playables - <track type>` to `Spine - <track type>`, `Spine Animation State Track` to `SkeletonAnimation Track`, `Spine AnimationState Graphic Track` to `SkeletonGraphic Track`, and `Spine Skeleton Flip Track` to `Skeleton Flip Track`.
* 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.
* **Changes of default values**

View File

@ -28,8 +28,6 @@
*****************************************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEngine;
@ -40,7 +38,7 @@ namespace Spine.Unity.Editor {
[CustomEditor(typeof(AnimationReferenceAsset))]
public class AnimationReferenceAssetEditor : Editor {
const string InspectorHelpText = "This is a Spine-Unity Animation Reference Asset. It serializes a reference to a SkeletonDataAsset and an animationName. It does not contain actual animation data. At runtime, it stores a reference to a Spine.Animation.\n\n" +
const string InspectorHelpText = "This is a Spine-Unity Animation Reference Asset. It serializes a reference to a SkeletonData asset and an animationName. It does not contain actual animation data. At runtime, it stores a reference to a Spine.Animation.\n\n" +
"You can use this in your AnimationState calls instead of a string animation name or a Spine.Animation reference. Use its implicit conversion into Spine.Animation or its .Animation property.\n\n" +
"Use AnimationReferenceAssets as an alternative to storing strings or finding animations and caching per component. This only does the lookup by string once, and allows you to store and manage animations via asset references.";

View File

@ -221,7 +221,7 @@ namespace Spine.Unity.Editor {
DrawAnimationList();
if (targetSkeletonData.Animations.Count > 0) {
const string AnimationReferenceButtonText = "Create Animation Reference Assets";
const string AnimationReferenceTooltipText = "AnimationReferenceAsset acts as Unity asset for a reference to a Spine.Animation. This can be used in inspectors.\n\nIt serializes a reference to a SkeletonDataAsset and an animationName.\n\nAt runtime, a reference to its Spine.Animation is loaded and cached into the object to be used as needed. This skips the need to find and cache animation references in individual MonoBehaviours.";
const string AnimationReferenceTooltipText = "AnimationReferenceAsset acts as Unity asset for a reference to a Spine.Animation. This can be used in inspectors.\n\nIt serializes a reference to a SkeletonData asset and an animationName.\n\nAt runtime, a reference to its Spine.Animation is loaded and cached into the object to be used as needed. This skips the need to find and cache animation references in individual MonoBehaviours.";
if (GUILayout.Button(SpineInspectorUtility.TempContent(AnimationReferenceButtonText, Icons.animationRoot, AnimationReferenceTooltipText), GUILayout.Width(250), GUILayout.Height(26))) {
CreateAnimationReferenceAssets();
}
@ -672,7 +672,7 @@ namespace Spine.Unity.Editor {
#if SPINE_TK2D
if (missingPaths.Count > 0)
warnings.Add("Missing regions. SkeletonDataAsset requires tk2DSpriteCollectionData or Spine AtlasAssets.");
warnings.Add("Missing regions. SkeletonData asset requires tk2DSpriteCollectionData or Spine AtlasAssets.");
#endif
}

View File

@ -27,7 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
using Spine.Unity;
using UnityEditor;
using UnityEngine;
@ -193,7 +192,7 @@ namespace Spine.Unity.Editor {
EditorGUILayout.HelpBox("Assigned SkeletonGraphic does not have SkeletonData assigned to it.", MessageType.Warning);
if (!boneFollowerSkeletonGraphic.IsValid)
EditorGUILayout.HelpBox("Assigned SkeletonGraphic is invalid. Check target SkeletonGraphic, its SkeletonDataAsset or the console for other errors.", MessageType.Warning);
EditorGUILayout.HelpBox("Assigned SkeletonGraphic is invalid. Check target SkeletonGraphic, its SkeletonData asset or the console for other errors.", MessageType.Warning);
}
}

View File

@ -199,7 +199,7 @@ namespace Spine.Unity.Editor {
EditorGUILayout.HelpBox("Assigned SkeletonRenderer does not have SkeletonData assigned to it.", MessageType.Warning);
if (!boneFollowerSkeletonRenderer.valid)
EditorGUILayout.HelpBox("Assigned SkeletonRenderer is invalid. Check target SkeletonRenderer, its SkeletonDataAsset or the console for other errors.", MessageType.Warning);
EditorGUILayout.HelpBox("Assigned SkeletonRenderer is invalid. Check target SkeletonRenderer, its SkeletonData asset or the console for other errors.", MessageType.Warning);
}
}

View File

@ -156,13 +156,13 @@ namespace Spine.Unity.Editor {
}
if (thisSkeletonGraphic.skeletonDataAsset == null) {
EditorGUILayout.HelpBox("You need to assign a SkeletonDataAsset first.", MessageType.Info);
EditorGUILayout.HelpBox("You need to assign a SkeletonData asset first.", MessageType.Info);
serializedObject.ApplyModifiedProperties();
serializedObject.Update();
return;
}
if (!SpineEditorUtilities.SkeletonDataAssetIsValid(thisSkeletonGraphic.skeletonDataAsset)) {
EditorGUILayout.HelpBox("Skeleton Data Asset error. Please check Skeleton Data Asset.", MessageType.Error);
EditorGUILayout.HelpBox("SkeletonData asset error. Please check SkeletonData asset.", MessageType.Error);
return;
}

View File

@ -291,12 +291,12 @@ namespace Spine.Unity.Editor {
}
if (component.skeletonDataAsset == null) {
EditorGUILayout.HelpBox("Skeleton Data Asset required", MessageType.Warning);
EditorGUILayout.HelpBox("SkeletonData asset required", MessageType.Warning);
return;
}
if (!SpineEditorUtilities.SkeletonDataAssetIsValid(component.skeletonDataAsset)) {
EditorGUILayout.HelpBox("Skeleton Data Asset error. Please check Skeleton Data Asset.", MessageType.Error);
EditorGUILayout.HelpBox("SkeletonData asset error. Please check SkeletonData asset.", MessageType.Error);
return;
}

View File

@ -31,11 +31,8 @@
#define NEW_PREFAB_SYSTEM
#endif
using Spine;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEngine;
namespace Spine.Unity.Editor {
@ -93,7 +90,7 @@ namespace Spine.Unity.Editor {
if ((skeletonRenderer != null && !skeletonRenderer.valid) ||
(skeletonGraphic != null && !skeletonGraphic.IsValid)) {
GUILayout.Label(new GUIContent("Spine Component invalid. Check Skeleton Data Asset.", Icons.warning));
GUILayout.Label(new GUIContent("Spine Component invalid. Check SkeletonData asset.", Icons.warning));
return;
}

View File

@ -143,7 +143,7 @@ namespace Spine.Unity.Editor {
SkeletonDataAsset skeletonDataAsset) {
skeletonDataAsset.skeletonDataModifiers.Remove(modifierAsset);
Debug.Log(string.Format("BlendModeMaterialsAsset upgraded to built-in BlendModeMaterials at SkeletonDataAsset '{0}'.",
Debug.Log(string.Format("BlendModeMaterialsAsset upgraded to built-in BlendModeMaterials at SkeletonData asset '{0}'.",
skeletonDataAsset.name), skeletonDataAsset);
EditorUtility.SetDirty(skeletonDataAsset);
}
@ -212,11 +212,11 @@ namespace Spine.Unity.Editor {
replacementMaterials.Add(replacement);
anyReplacementMaterialsChanged = true;
if (createdNewMaterial) {
Debug.Log(string.Format("Created blend mode Material '{0}' for SkeletonDataAsset '{1}'.",
Debug.Log(string.Format("Created blend mode Material '{0}' for SkeletonData asset '{1}'.",
replacement.material.name, skeletonDataAsset), replacement.material);
}
} else {
Debug.LogError(string.Format("Failed creating blend mode Material for SkeletonDataAsset '{0}'," +
Debug.LogError(string.Format("Failed creating blend mode Material for SkeletonData asset '{0}'," +
" atlas page '{1}', template '{2}'.",
skeletonDataAsset.name, originalRegion.page.name, materialTemplate.name),
skeletonDataAsset);

View File

@ -33,14 +33,10 @@
#define SPINE_SKELETONMECANIM
using Spine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
namespace Spine.Unity.Editor {
@ -181,7 +177,7 @@ namespace Spine.Unity.Editor {
public static void BakeToPrefab (SkeletonDataAsset skeletonDataAsset, ExposedList<Skin> skins, string outputPath = "", bool bakeAnimations = true, bool bakeIK = true, SendMessageOptions eventOptions = SendMessageOptions.DontRequireReceiver) {
if (skeletonDataAsset == null || skeletonDataAsset.GetSkeletonData(true) == null) {
Debug.LogError("Could not export Spine Skeleton because SkeletonDataAsset is null or invalid!");
Debug.LogError("Could not export Spine Skeleton because SkeletonData Asset is null or invalid!");
return;
}

View File

@ -232,7 +232,7 @@ namespace Spine.Unity.Editor {
#endif
}
EditorGUILayout.PropertyField(settings.FindProperty("autoReloadSceneSkeletons"), new GUIContent("Auto-reload scene components", "Reloads Skeleton components in the scene whenever their SkeletonDataAsset is modified. This makes it so changes in the SkeletonDataAsset inspector are immediately reflected. This may be slow when your scenes have large numbers of SkeletonRenderers or SkeletonGraphic."));
EditorGUILayout.PropertyField(settings.FindProperty("autoReloadSceneSkeletons"), new GUIContent("Auto-reload scene components", "Reloads Skeleton components in the scene whenever their SkeletonDataAsset is modified. This makes it so changes in the SkeletonData asset inspector are immediately reflected. This may be slow when your scenes have large numbers of SkeletonRenderers or SkeletonGraphic."));
EditorGUILayout.Separator();
EditorGUILayout.LabelField("Auto-Import Settings", EditorStyles.boldLabel);

View File

@ -11,17 +11,22 @@ Timeline support is provided as a separate UPM (Unity Package Manager) package.
![](add-menu.png)
Spine Timeline currently provides three types of Timeline Playables:
- `Spine AnimationState Track` *(for `SkeletonAnimation`)*,
- `Spine AnimationState Graphic Track` *(for `SkeletonGraphic`)*,
- `Spine Skeleton Flip Track` *(for both `SkeletonAnimation` and `SkeletonGraphic`)*.
- `SkeletonAnimation Track` *(animates `SkeletonAnimation`)*,
- `SkeletonGraphic Track` *(animates `SkeletonGraphic`)*,
- `Skeleton Flip Track` *(flips `SkeletonAnimation` or `SkeletonGraphic`)*.
> Note: Timeline tracks have been renamed in recent versions to improve readability.
`SkeletonAnimation Track` was called `Spine AnimationState Track`,
`SkeletonGraphic Track` was called `Spine AnimationState Graphic Track`,
`Skeleton Flip Track` was called `Spine Skeleton Flip Track`.
**Limitations:** currently only [SkeletonAnimation](#SkeletonAnimation-Component) and [SkeletonGraphic](#SkeletonGraphic-Component) are supported. There is currently no Timeline support for [SkeletonMecanim](#SkeletonMecanim-Component).
#### Spine AnimationState Track
#### SkeletonAnimation Track and SkeletonGraphic Track
![](animationstate-track.png)
This track type can be used to set animations at the AnimationState of the target `SkeletonAnimation` or `SkeletonGraphic`. Track type `Spine AnimationState Track` is used for `SkeletonAnimation`, `Spine AnimationState Graphic Track` for `SkeletonGraphic`.
These track types can be used to set animations at the AnimationState of the target `SkeletonAnimation` or `SkeletonGraphic`. Track type `SkeletonAnimation Track` is used for `SkeletonAnimation`, `SkeletonGraphic Track` for `SkeletonGraphic`.
![](animationstate-track-inspector.png)
@ -31,25 +36,25 @@ This track type can be used to set animations at the AnimationState of the targe
##### Spine Animation State Clip
You can add a `Spine Animation State Clip` to a `Spine AnimationState Track` (or `Spine AnimationState Graphic Track`) by dragging an `AnimationReferenceAsset` onto a Timeline track. See the [SkeletonData - Preview](#Preview) section on how to generate `AnimationReferenceAssets` for a `SkeletonDataAsset`.
You can add a `Spine Animation State Clip` to a `SkeletonAnimation Track` (or `SkeletonGraphic Track`) by dragging an `AnimationReferenceAsset` onto a Timeline track. See the [SkeletonData - Preview](#Preview) section on how to generate `AnimationReferenceAssets` for a `SkeletonDataAsset`.
![](animationstate-clip-inspector.png)
**Parameters**
*Clip Timing*
- *Clip In.* An initial local start time offset applied when playing this animation. Can also be adjusted by dragging the left edge of the clip.
- *Blend In Duration.* Blend transition duration used when `Use Blend Duration` and `Custom duration` are enabled. Can be adjusted by moving the clip into the previous clip, resulting in a cross-fade triangle at the transition.
- *Blend In Duration.* Blend transition duration used when `Use Blend Duration` is enabled and `Default Mix Duration` is disabled. Can be adjusted by moving the clip into the previous clip, resulting in a cross-fade triangle at the transition.
- *Speed Multiplier.* Playback speed multiplier. When set to 2.0 it will play the animation twice as fast, when set to 0.5 half as fast.
*Spine Animation State Clip*
- *Don't Pause with Director.* If set to true, the animation will continue playing when the Director is paused.
- *Don't End with Clip.* Normally when empty space follows the clip on the timeline, the empty animation is set on the track. Set this parameter to true to continue playing the clip's animation instead.
- *Don't End with Clip.* Normally when empty space follows the clip on the timeline, the empty animation is set on the track. Set this parameter to true to continue playing the clip's animation instead.
- *Clip End Mix Out Duration.* When `Don't End with Clip` is false, and the clip is followed by blank space or stopped, the empty animation is set with this `MixDuration`. When set to a value less than 0, the clip is paused instead.
*Mixing Setting*
- *Custom duration.* When enabled, the value under `Mix Duration` below is used for transitions from the previous animation to this animation. When disabled, it will use the setup `Mix Duration` value at the SkeletonData asset for the animation pair.
- *Default Mix Duration.* When disabled, the value under `Mix Duration` below is used for transitions from the previous animation to this animation. When enabled, it will use the setup `Mix Duration` value at the SkeletonData asset for the animation pair.
- *Use Blend Duration.* When enabled, the value under `Mix Duration` will be synced with the timeline clip transition duration 'Ease In Duration'. Enable this value to adjust transition durations by moving the clip into the previous clip, resulting in a cross-fade triangle at the transition.
- *Mix Duration.* When *Custom duration* is enabled, this mix duration is used for transitions from the previous animation to this animation.
- *Mix Duration.* When *Default Mix Duration* is disabled, this mix duration is used for transitions from the previous animation to this animation.
- *Event Threshold.* See [TrackEntry.EventThreshold](http://esotericsoftware.com/spine-api-reference#TrackEntry-eventThreshold).
- *Attachment Threshold.* See [TrackEntry.AttachmentThreshold](http://esotericsoftware.com/spine-api-reference#TrackEntry-attachmentThreshold).
- *Draw Order Threshold.* See [TrackEntry.DrawOrderThreshold](http://esotericsoftware.com/spine-api-reference#TrackEntry-drawOrderThreshold).
@ -57,9 +62,11 @@ You can add a `Spine Animation State Clip` to a `Spine AnimationState Track` (or
*Ignored Parameters*
- *Ease Out Duration, Blend Curves*. These parameters are ignored and have no effect.
> Note: *Default Mix Duration* was previously called *Custom Duration* and inverted. This has been changed to improve readability.
**Usage**
1. Add `SkeletonAnimationPlayableHandle` component to your SkeletonAnimation GameObject, or the `SkeletonGraphicPlayableHandle` in case of `SkeletonGraphic`.
2. With an existing Unity Playable Director, and in the Unity Timeline window, right-click on an empty space on the left and choose `Spine.Unity.Playables` - `Spine Animation State Track`.
2. With an existing Unity Playable Director, and in the Unity Timeline window, right-click on an empty space on the left and choose `Spine` - `SkeletonAnimation Track`.
3. Drag the SkeletonAnimation or SkeletonGraphic GameObject onto the empty reference property of the new Spine AnimationState Track.
4. To add an animation at a track, drag the respective [`AnimationReferenceAsset`](#Preview) into the clips view (the right part of the Timeline panel) as you would with normal animation clips.
@ -77,7 +84,7 @@ See spine-unity Runtime Documentation, [section Preview](#Preview) on how to cre
- What happens at the end of clips and at the end of the timeline depends on clip settings. When `Don't End with Clip` is true, nothing happens at the clip's end. This means the effect of the last clip's `SetAnimation` call will persist until you issue other calls at the AnimationState. If `Don't End with Clip` is false, it will be mix out to the empty animation with duration `Clip End Mix Out Duration`, or paused when `Clip End Mix Out Duration` is less than 0.
- Edit mode preview mixing may look different from Play Mode mixing. Please check in actual Play Mode to see the actual results. Please see the remark in the [Spine AnimationState Track](#Spine-AnimationState-Track) section on correct track ordering when previewing multiple overlaid tracks.
#### Spine Skeleton Flip Track
#### Skeleton Flip Track
![](skeleton-flip-track.png)
@ -93,9 +100,9 @@ This track type can be used to flip the skeleton of the target `SkeletonAnimatio
**Usage**
1. Add `SkeletonAnimationPlayableHandle` component to your SkeletonAnimation GameObject, or the `SkeletonGraphicPlayableHandle` in case of `SkeletonGraphic`.
2. With an existing Unity Playable Director, and in the Unity Timeline window, right-click on an empty space on the left and choose `Spine.Unity.Playables` - `Spine Skeleton Flip Track`.
2. With an existing Unity Playable Director, and in the Unity Timeline window, right-click on an empty space on the left and choose `Spine` - `Skeleton Flip Track`.
3. Drag the SkeletonAnimation or SkeletonGraphic GameObject onto the empty reference property of the new Spine Skeleton Flip Track.
4. Right-click on the row in an empty space in the Timeline dopesheet and choose `Add Spine Skeleton Flip Clip Clip`.
4. Right-click on the row in an empty space in the Timeline dopesheet and choose `Add Spine Skeleton Flip Clip`.
5. Adjust the start and end times of the new clip, name it appropriately at the top of the Inspector, and choose the desired FlipX and FlipY values.
**Track Behavior**
@ -103,4 +110,6 @@ This track type can be used to flip the skeleton of the target `SkeletonAnimatio
- At the end of the timeline, the track will revert the skeleton flip to the flip values it captures when it starts playing that timeline.
#### Known Issues
- The Console potentially logs an incorrect and harmless error `DrivenPropertyManager has failed to register property "m_Script" of object "Spine GameObject (spineboy-pro)" with driver "" because the property doesn't exist.`. This is a known issue on Unity's end. See more here: https://forum.unity.com/threads/default-playables-text-switcher-track-error.502903/
- The Console potentially logs an incorrect and harmless error `DrivenPropertyManager has failed to register property "m_Script" of object "Spine GameObject (spineboy-pro)" with driver "" because the property doesn't exist.`. This is a known issue on Unity's end. See more here: https://forum.unity.com/threads/default-playables-text-switcher-track-error.502903/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -27,8 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
using Spine;
using Spine.Unity;
using Spine.Unity.Editor;
using Spine.Unity.Playables;
using UnityEditor;
@ -100,7 +98,10 @@ public class SpineAnimationStateDrawer : PropertyDrawer {
EditorGUI.LabelField(singleFieldRect, "Mixing Settings", EditorStyles.boldLabel);
singleFieldRect.y += lineHeightWithSpacing;
EditorGUI.PropertyField(singleFieldRect, customDurationProp);
customDurationProp.boolValue = !EditorGUI.Toggle(singleFieldRect,
new GUIContent("Default Mix Duration",
"Use the default mix duration as specified at the SkeletonDataAsset."),
!customDurationProp.boolValue);
bool greyOutCustomDurations = (!customDurationProp.hasMultipleDifferentValues &&
customDurationProp.boolValue == false);

View File

@ -29,24 +29,21 @@
using Spine.Unity.Playables;
using UnityEditor;
using UnityEditor.Timeline;
using UnityEngine;
using UnityEngine.Timeline;
namespace Spine.Unity.Editor {
[CustomEditor(typeof(SpineAnimationStateGraphicTrack))]
[CustomTimelineEditor(typeof(SpineAnimationStateGraphicTrack))]
[CanEditMultipleObjects]
public class SpineAnimationStateGraphicTrackInspector : UnityEditor.Editor {
public class SpineAnimationStateGraphicTrackInspector : TrackEditor {
protected SerializedProperty trackIndexProperty = null;
public void OnEnable () {
trackIndexProperty = serializedObject.FindProperty("trackIndex");
}
public override void OnInspectorGUI () {
serializedObject.Update();
EditorGUILayout.PropertyField(trackIndexProperty);
serializedObject.ApplyModifiedProperties();
public override TrackDrawOptions GetTrackOptions (TrackAsset track, UnityEngine.Object binding) {
var options = base.GetTrackOptions(track, binding);
options.icon = SpineEditorUtilities.Icons.skeletonDataAssetIcon;
options.trackColor = new Color(255 / 255.0f, 64 / 255.0f, 1 / 255.0f);
return options;
}
}
}

View File

@ -29,24 +29,20 @@
using Spine.Unity.Playables;
using UnityEditor;
using UnityEditor.Timeline;
using UnityEngine;
using UnityEngine.Timeline;
namespace Spine.Unity.Editor {
[CustomEditor(typeof(SpineAnimationStateTrack))]
[CustomTimelineEditor(typeof(SpineAnimationStateTrack))]
[CanEditMultipleObjects]
public class SpineAnimationStateTrackInspector : UnityEditor.Editor {
public class SpineAnimationStateTrackInspector : TrackEditor {
protected SerializedProperty trackIndexProperty = null;
public void OnEnable () {
trackIndexProperty = serializedObject.FindProperty("trackIndex");
}
public override void OnInspectorGUI () {
serializedObject.Update();
EditorGUILayout.PropertyField(trackIndexProperty);
serializedObject.ApplyModifiedProperties();
public override TrackDrawOptions GetTrackOptions (TrackAsset track, UnityEngine.Object binding) {
var options = base.GetTrackOptions(track, binding);
options.icon = SpineEditorUtilities.Icons.skeletonDataAssetIcon;
options.trackColor = new Color(255 / 255.0f, 64 / 255.0f, 1 / 255.0f);
return options;
}
}
}

View File

@ -0,0 +1,48 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions.
*
* Copyright (c) 2013-2020, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
using Spine.Unity.Playables;
using UnityEditor;
using UnityEditor.Timeline;
using UnityEngine;
using UnityEngine.Timeline;
namespace Spine.Unity.Editor {
[CustomTimelineEditor(typeof(SpineSkeletonFlipTrack))]
[CanEditMultipleObjects]
public class SpineSkeletonFlipTrackInspector : TrackEditor {
public override TrackDrawOptions GetTrackOptions (TrackAsset track, UnityEngine.Object binding) {
var options = base.GetTrackOptions(track, binding);
options.icon = SpineEditorUtilities.Icons.subMeshRenderer;
options.trackColor = new Color(0.855f, 0.8623f, 0.87f);
return options;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 79b46a12efaac314eaf936caf1f3aee9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -27,14 +27,20 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#if UNITY_EDITOR
using System.ComponentModel;
#endif
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
namespace Spine.Unity.Playables {
[TrackColor(0.9960785f, 0.2509804f, 0.003921569f)]
[TrackColor(255 / 255.0f, 64 / 255.0f, 1 / 255.0f)]
[TrackClipType(typeof(SpineAnimationStateClip))]
[TrackBindingType(typeof(SkeletonGraphic))]
#if UNITY_EDITOR
[DisplayName("Spine/SkeletonGraphic Track")]
#endif
public class SpineAnimationStateGraphicTrack : TrackAsset {
public int trackIndex = 0;

View File

@ -303,12 +303,14 @@ namespace Spine.Unity.Playables {
if (toAnimation != null)
toAnimation.Apply(skeleton, 0, toClipTime, clipData.loop, null, 1f, MixBlend.Setup, MixDirection.In);
}
skeleton.UpdateWorldTransform();
if (skeletonAnimation)
if (skeletonAnimation) {
skeletonAnimation.Update(0);
skeletonAnimation.LateUpdate();
else if (skeletonGraphic)
} else if (skeletonGraphic) {
skeletonGraphic.Update(0);
skeletonGraphic.LateUpdate();
}
}
// Do nothing outside of the first clip and the last clip.

View File

@ -27,15 +27,21 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#if UNITY_EDITOR
using System.ComponentModel;
#endif
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
namespace Spine.Unity.Playables {
[TrackColor(0.9960785f, 0.2509804f, 0.003921569f)]
[TrackColor(255 / 255.0f, 64 / 255.0f, 1 / 255.0f)]
[TrackClipType(typeof(SpineAnimationStateClip))]
[TrackBindingType(typeof(SkeletonAnimation))]
#if UNITY_EDITOR
[DisplayName("Spine/SkeletonAnimation Track")]
#endif
public class SpineAnimationStateTrack : TrackAsset {
public int trackIndex = 0;

View File

@ -27,8 +27,9 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
using Spine.Unity;
using System.Collections.Generic;
#if UNITY_EDITOR
using System.ComponentModel;
#endif
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
@ -38,6 +39,9 @@ namespace Spine.Unity.Playables {
[TrackColor(0.855f, 0.8623f, 0.87f)]
[TrackClipType(typeof(SpineSkeletonFlipClip))]
[TrackBindingType(typeof(SpinePlayableHandleBase))]
#if UNITY_EDITOR
[DisplayName("Spine/Skeleton Flip Track")]
#endif
public class SpineSkeletonFlipTrack : TrackAsset {
public override Playable CreateTrackMixer (PlayableGraph graph, GameObject go, int inputCount) {
return ScriptPlayable<SpineSkeletonFlipMixerBehaviour>.Create(graph, inputCount);

View File

@ -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.2",
"version": "4.1.3",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",

View File

@ -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.2",
"version": "4.1.3",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",