diff --git a/CHANGELOG.md b/CHANGELOG.md
index 11b2a97b8..68c372561 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -114,8 +114,11 @@
* `TrackEntry` has an additional field called `holdPrevious`. It can be used to counter act a limitation of `AnimationState` resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this [forum thread](http://esotericsoftware.com/forum/Probably-Easy-Animation-mixing-with-multiple-tracks-10682?p=48130&hilit=holdprevious#p48130).
### Unity
-* **Runtime and Editor, and Assembly Definition** Files and folders have been reorganized into "Runtime" and "Editor". Each of these have an `.asmdef` file that defines these separately as their own assembly in Unity. For projects not using assembly definition, you may delete the `.asmdef` files. These assembly definitions will be ignored by older versions of Unity that don't support it.
+* **Runtime and Editor, and Assembly Definition** Files and folders have been reorganized into "Runtime" and "Editor". Each of these have an `.asmdef` file that defines these separately as their own assembly in Unity *(Note: Spine `.asmdef` files are currently deactivated to `.txt` extension, see below)*. For projects not using assembly definition, you may delete the `.asmdef` files. These assembly definitions will be ignored by older versions of Unity that don't support it.
* In this scheme, the entirety of the base spine-csharp runtime is inside the "Runtime" folder, to be compiled in the same assembly as spine-unity so they can continue to share internal members.
+* **Spine `.asmdef` files are now deactivated (using `.txt` extension) by default** This prevents problems when updating Spine through unitypackages, overwriting the Timeline reference entry in `spine-unity.asmdef` (added automatically when enabling Unity 2019 Timeline support, see `Timeline Support for Unity 2019`), causing compile errors. In case you want to enable the `.asmdef` files, rename the files:
+ `Spine/Runtime/spine-unity.txt` to `Spine/Runtime/spine-unity.asmdef` and
+ `Spine/Editor/spine-unity-editor.txt` to `Spine/Editor/spine-unity-editor.asmdef`.
* **SkeletonAnimator is now SkeletonMecanim** The Spine-Unity Mecanim-driven component `SkeletonAnimator` has been renamed `SkeletonMecanim` to make it more autocomplete-friendly and more obvious at human-glance. The .meta files and guids should remain intact so existing projects and prefabs should not break. However, user code needs to be updated to use `SkeletonMecanim`.
* **SpineAtlasAsset** The existing `AtlasAsset` type has been renamed to `SpineAtlasAsset` to signify that it specifically uses a Spine/libGDX atlas as its source. Serialization should be intact but user code will need to be updated to refer to existing atlases as `SpineAtlasAsset`.
* **AtlasAssetBase** `SpineAtlasAsset` now has an abstract base class called `SpineAtlasAsset`. This is the base class to derive when using alternate atlas sources. Existing SkeletonDataAsset field "atlasAssets" now have the "AtlasAssetBase" type. Serialization should be intact, but user code will need to be updated to refer to the atlas assets accordingly.
@@ -155,6 +158,11 @@
* `CompareFunction.LessEqual` for `Mask Interaction - Visible Inside Mask`
* `CompareFunction.Greater` for `Mask Interaction - Visible Outside Mask`
* **RectMask2D Support for SkeletonGraphic** Both `SkeletonGraphic` shaders '`Spine/SkeletonGraphic`' and '`Spine/SkeletonGraphic Tint Black`' now respect masking areas defined via Unity's `RectMask2D` component.
+* **Timeline Support for Unity 2019** using the existing Timeline components. By default, all Spine Timeline components are deactivated in Unity 2019 and **can be activated via the Spine Preferences menu**. This step became necessary because in Unity 2019, Timeline has been moved to a separate Package and is no longer included in the Unity core. Please visit `Edit - Preferences - Spine` and at `Timeline Package Support` hit `Enable` to automatically perform all necessary steps to activate the Timeline components.
+This will automatically:
+ 1. download the Unity Timeline package
+ 2. activate the Spine Timeline components by setting the compile definition `SPINE_TIMELINE_PACKAGE_DOWNLOADED` for all platforms
+ 3. modify the `spine-unity.asmdef` file by adding the reference to the Unity Timeline library.
### XNA/MonoGame
* Added support for any `Effect` to be used by `SkeletonRenderer`
diff --git a/spine-unity/Assets/Spine/Editor/spine-unity-editor.asmdef b/spine-unity/Assets/Spine/Editor/spine-unity-editor.txt
similarity index 100%
rename from spine-unity/Assets/Spine/Editor/spine-unity-editor.asmdef
rename to spine-unity/Assets/Spine/Editor/spine-unity-editor.txt
diff --git a/spine-unity/Assets/Spine/Editor/spine-unity-editor.asmdef.meta b/spine-unity/Assets/Spine/Editor/spine-unity-editor.txt.meta
similarity index 100%
rename from spine-unity/Assets/Spine/Editor/spine-unity-editor.asmdef.meta
rename to spine-unity/Assets/Spine/Editor/spine-unity-editor.txt.meta
diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs
index 4c8d172f4..f17fd139d 100644
--- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs
+++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs
@@ -45,6 +45,10 @@
#define NEWHIERARCHYWINDOWCALLBACKS
#endif
+#if UNITY_2019_1_OR_NEWER
+#define NEW_TIMELINE_AS_PACKAGE
+#endif
+
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
@@ -426,7 +430,21 @@ namespace Spine.Unity.Editor {
}
}
+ #if NEW_TIMELINE_AS_PACKAGE
+ GUILayout.Space(20);
+ EditorGUILayout.LabelField("Timeline Support", EditorStyles.boldLabel);
+ using (new GUILayout.HorizontalScope()) {
+ EditorGUILayout.PrefixLabel("Timeline Package Support");
+ var requestState = SpineEditorUtilities.SpinePackageDependencyUtility.HandlePendingAsyncTimelineRequest();
+ using (new EditorGUI.DisabledGroupScope(requestState != SpineEditorUtilities.SpinePackageDependencyUtility.RequestState.NoRequestIssued)) {
+ if (GUILayout.Button("Enable", GUILayout.Width(64)))
+ SpineEditorUtilities.SpinePackageDependencyUtility.EnableTimelineSupport();
+ if (GUILayout.Button("Disable", GUILayout.Width(64)))
+ SpineEditorUtilities.SpinePackageDependencyUtility.DisableTimelineSupport();
+ }
+ }
+ #endif
GUILayout.Space(20);
EditorGUILayout.LabelField("3rd Party Settings", EditorStyles.boldLabel);
@@ -1788,95 +1806,275 @@ namespace Spine.Unity.Editor {
internal static class SpineTK2DEditorUtility {
const string SPINE_TK2D_DEFINE = "SPINE_TK2D";
- static bool IsInvalidGroup (BuildTargetGroup group) {
- int gi = (int)group;
- return
- gi == 15 || gi == 16
- ||
- group == BuildTargetGroup.Unknown;
- }
-
internal static void EnableTK2D () {
- bool added = false;
-
- DisableSpineAsmdefFiles();
-
- foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) {
- if (IsInvalidGroup(group))
- continue;
-
- string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group);
- if (!defines.Contains(SPINE_TK2D_DEFINE)) {
- added = true;
- if (defines.EndsWith(";", System.StringComparison.Ordinal))
- defines = defines + SPINE_TK2D_DEFINE;
- else
- defines = defines + ";" + SPINE_TK2D_DEFINE;
-
- PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines);
- }
- }
-
- if (added) {
- Debug.LogWarning("Setting Scripting Define Symbol " + SPINE_TK2D_DEFINE);
- } else {
- Debug.LogWarning("Already Set Scripting Define Symbol " + SPINE_TK2D_DEFINE);
- }
+ SpineBuildEnvUtility.DisableSpineAsmdefFiles();
+ SpineBuildEnvUtility.EnableBuildDefine(SPINE_TK2D_DEFINE);
}
-
internal static void DisableTK2D () {
- bool removed = false;
+ SpineBuildEnvUtility.EnableSpineAsmdefFiles();
+ SpineBuildEnvUtility.DisableBuildDefine(SPINE_TK2D_DEFINE);
+ }
+ }
- EnableSpineAsmdefFiles();
+ public static class SpinePackageDependencyUtility
+ {
+ public enum RequestState {
+ NoRequestIssued = 0,
+ InProgress,
+ Success,
+ Failure
+ }
- foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) {
- if (IsInvalidGroup(group))
- continue;
+ #if NEW_TIMELINE_AS_PACKAGE
+ const string SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE = "SPINE_TIMELINE_PACKAGE_DOWNLOADED";
+ const string TIMELINE_PACKAGE_NAME = "com.unity.timeline";
+ const string TIMELINE_ASMDEF_DEPENDENCY_STRING = "\"Unity.Timeline\"";
+ static UnityEditor.PackageManager.Requests.AddRequest timelineRequest = null;
+
+ ///
+ /// Enables Spine's Timeline components by downloading the Timeline Package in Unity 2019 and newer
+ /// and setting respective compile definitions once downloaded.
+ ///
+ internal static void EnableTimelineSupport () {
+ Debug.Log("Downloading Timeline package " + TIMELINE_PACKAGE_NAME + ".");
+ timelineRequest = UnityEditor.PackageManager.Client.Add(TIMELINE_PACKAGE_NAME);
+ // Note: unfortunately there is no callback provided, only polling support.
+ // So polling HandlePendingAsyncTimelineRequest() is necessary.
- string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group);
- if (defines.Contains(SPINE_TK2D_DEFINE)) {
- removed = true;
- if (defines.Contains(SPINE_TK2D_DEFINE + ";"))
- defines = defines.Replace(SPINE_TK2D_DEFINE + ";", "");
- else
- defines = defines.Replace(SPINE_TK2D_DEFINE, "");
+ EditorApplication.update -= UpdateAsyncTimelineRequest;
+ EditorApplication.update += UpdateAsyncTimelineRequest;
+ }
- PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines);
+ public static void UpdateAsyncTimelineRequest () {
+ HandlePendingAsyncTimelineRequest();
+ }
+
+ public static RequestState HandlePendingAsyncTimelineRequest () {
+ if (timelineRequest == null)
+ return RequestState.NoRequestIssued;
+
+ var status = timelineRequest.Status;
+ if (status == UnityEditor.PackageManager.StatusCode.InProgress) {
+ return RequestState.InProgress;
+ }
+ else {
+ EditorApplication.update -= UpdateAsyncTimelineRequest;
+ timelineRequest = null;
+ if (status == UnityEditor.PackageManager.StatusCode.Failure) {
+ Debug.LogError("Download of package " + TIMELINE_PACKAGE_NAME + " failed!");
+ return RequestState.Failure;
+ }
+ else { // status == UnityEditor.PackageManager.StatusCode.Success
+ HandleSuccessfulTimelinePackageDownload();
+ return RequestState.Success;
}
}
-
- if (removed) {
- Debug.LogWarning("Removing Scripting Define Symbol " + SPINE_TK2D_DEFINE);
- } else {
- Debug.LogWarning("Already Removed Scripting Define Symbol " + SPINE_TK2D_DEFINE);
- }
}
- internal static void DisableSpineAsmdefFiles() {
- SetAsmdefFileActive("spine-unity-editor", false);
- SetAsmdefFileActive("spine-unity", false);
+ internal static void DisableTimelineSupport () {
+ SpineBuildEnvUtility.DisableBuildDefine(SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE);
+ SpineBuildEnvUtility.RemoveDependencyFromAsmdefFile(TIMELINE_ASMDEF_DEPENDENCY_STRING);
}
- internal static void EnableSpineAsmdefFiles() {
- SetAsmdefFileActive("spine-unity-editor", true);
- SetAsmdefFileActive("spine-unity", true);
+ internal static void HandleSuccessfulTimelinePackageDownload () {
+
+ #if !SPINE_TK2D
+ SpineBuildEnvUtility.EnableSpineAsmdefFiles();
+ #endif
+ SpineBuildEnvUtility.AddDependencyToAsmdefFile(TIMELINE_ASMDEF_DEPENDENCY_STRING);
+ SpineBuildEnvUtility.EnableBuildDefine(SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE);
+
+ ReimportTimelineScripts();
}
- internal static void SetAsmdefFileActive(string filename, bool setActive) {
+ internal static void ReimportTimelineScripts () {
+ // Note: unfortunately AssetDatabase::Refresh is not enough and
+ // ImportAsset on a dir does not have the desired effect.
+ List searchStrings = new List();
+ searchStrings.Add("SpineAnimationStateBehaviour t:script");
+ searchStrings.Add("SpineAnimationStateClip t:script");
+ searchStrings.Add("SpineAnimationStateMixerBehaviour t:script");
+ searchStrings.Add("SpineAnimationStateTrack t:script");
- string typeSearchString = setActive ? " t:TextAsset" : " t:AssemblyDefinitionAsset";
- string[] guids = AssetDatabase.FindAssets(filename + typeSearchString);
- foreach (string guid in guids) {
- string currentPath = AssetDatabase.GUIDToAssetPath(guid);
- string targetPath = System.IO.Path.ChangeExtension(currentPath, setActive ? "asmdef" : "txt");
- if (System.IO.File.Exists(currentPath) && !System.IO.File.Exists(targetPath)) {
- System.IO.File.Copy(currentPath, targetPath);
- System.IO.File.Copy(currentPath + ".meta", targetPath + ".meta");
+ searchStrings.Add("SpineSkeletonFlipBehaviour t:script");
+ searchStrings.Add("SpineSkeletonFlipClip t:script");
+ searchStrings.Add("SpineSkeletonFlipMixerBehaviour t:script");
+ searchStrings.Add("SpineSkeletonFlipTrack t:script");
+
+ searchStrings.Add("SkeletonAnimationPlayableHandle t:script");
+ searchStrings.Add("SpinePlayableHandleBase t:script");
+
+ foreach (string searchString in searchStrings) {
+ string[] guids = AssetDatabase.FindAssets(searchString);
+ foreach (string guid in guids) {
+ string currentPath = AssetDatabase.GUIDToAssetPath(guid);
+ AssetDatabase.ImportAsset(currentPath, ImportAssetOptions.ForceUpdate);
}
- AssetDatabase.DeleteAsset(currentPath);
}
}
+ #endif
+ }
+ }
+
+ public static class SpineBuildEnvUtility
+ {
+ static bool IsInvalidGroup (BuildTargetGroup group) {
+ int gi = (int)group;
+ return
+ gi == 15 || gi == 16
+ ||
+ group == BuildTargetGroup.Unknown;
+ }
+
+ public static bool EnableBuildDefine (string define) {
+
+ bool wasDefineAdded = false;
+ Debug.LogWarning("Please ignore errors \"PlayerSettings Validation: Requested build target group doesn't exist\" below");
+ foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) {
+ if (IsInvalidGroup(group))
+ continue;
+
+ string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group);
+ if (!defines.Contains(define)) {
+ wasDefineAdded = true;
+ if (defines.EndsWith(";", System.StringComparison.Ordinal))
+ defines += define;
+ else
+ defines += ";" + define;
+
+ PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines);
+ }
+ }
+ Debug.LogWarning("Please ignore errors \"PlayerSettings Validation: Requested build target group doesn't exist\" above");
+
+ if (wasDefineAdded) {
+ Debug.LogWarning("Setting Scripting Define Symbol " + define);
+ }
+ else {
+ Debug.LogWarning("Already Set Scripting Define Symbol " + define);
+ }
+ return wasDefineAdded;
+ }
+
+ public static bool DisableBuildDefine (string define) {
+
+ bool wasDefineRemoved = false;
+ foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) {
+ if (IsInvalidGroup(group))
+ continue;
+
+ string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group);
+ if (defines.Contains(define)) {
+ wasDefineRemoved = true;
+ if (defines.Contains(define + ";"))
+ defines = defines.Replace(define + ";", "");
+ else
+ defines = defines.Replace(define, "");
+
+ PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines);
+ }
+ }
+
+ if (wasDefineRemoved) {
+ Debug.LogWarning("Removing Scripting Define Symbol " + define);
+ }
+ else {
+ Debug.LogWarning("Already Removed Scripting Define Symbol " + define);
+ }
+ return wasDefineRemoved;
+ }
+
+ public static void DisableSpineAsmdefFiles () {
+ SetAsmdefFileActive("spine-unity-editor", false);
+ SetAsmdefFileActive("spine-unity", false);
+ }
+
+ public static void EnableSpineAsmdefFiles () {
+ SetAsmdefFileActive("spine-unity-editor", true);
+ SetAsmdefFileActive("spine-unity", true);
+ }
+
+ public static void AddDependencyToAsmdefFile (string dependencyName) {
+ string asmdefName = "spine-unity";
+ string filePath = FindAsmdefFile(asmdefName);
+ if (string.IsNullOrEmpty(filePath))
+ return;
+
+ if (System.IO.File.Exists(filePath)) {
+ string fileContent = File.ReadAllText(filePath);
+
+ if (!fileContent.Contains("references")) {
+ string nameLine = string.Concat("\"name\": \"", asmdefName, "\"");
+ fileContent = fileContent.Replace(nameLine,
+ nameLine +
+ @",\n""references"": []");
+ }
+
+ if (!fileContent.Contains(dependencyName)) {
+ fileContent = fileContent.Replace(@"""references"": [",
+ @"""references"": [" + dependencyName);
+ File.WriteAllText(filePath, fileContent);
+ }
+ }
+ }
+
+ public static void RemoveDependencyFromAsmdefFile (string dependencyName) {
+ string asmdefName = "spine-unity";
+ string filePath = FindAsmdefFile(asmdefName);
+ if (string.IsNullOrEmpty(filePath))
+ return;
+
+ if (System.IO.File.Exists(filePath)) {
+ string fileContent = File.ReadAllText(filePath);
+ // this simple implementation shall suffice for now.
+ if (fileContent.Contains(dependencyName)) {
+ fileContent = fileContent.Replace(dependencyName, "");
+ File.WriteAllText(filePath, fileContent);
+ }
+ }
+ }
+
+ internal static string FindAsmdefFile (string filename) {
+ string filePath = FindAsmdefFile(filename, isDisabledFile: false);
+ if (string.IsNullOrEmpty(filePath))
+ filePath = FindAsmdefFile(filename, isDisabledFile: true);
+ return filePath;
+ }
+
+ internal static string FindAsmdefFile (string filename, bool isDisabledFile) {
+
+ string typeSearchString = isDisabledFile ? " t:TextAsset" : " t:AssemblyDefinitionAsset";
+ string extension = isDisabledFile ? ".txt" : ".asmdef";
+ string filenameWithExtension = filename + (isDisabledFile ? ".txt" : ".asmdef");
+ string[] guids = AssetDatabase.FindAssets(filename + typeSearchString);
+ foreach (string guid in guids) {
+ string currentPath = AssetDatabase.GUIDToAssetPath(guid);
+ if (!string.IsNullOrEmpty(currentPath)) {
+ if (System.IO.Path.GetFileName(currentPath) == filenameWithExtension)
+ return currentPath;
+ }
+ }
+ return null;
+ }
+
+ internal static void SetAsmdefFileActive (string filename, bool setActive) {
+
+ string typeSearchString = setActive ? " t:TextAsset" : " t:AssemblyDefinitionAsset";
+ string extensionBeforeChange = setActive ? "txt" : "asmdef";
+ string[] guids = AssetDatabase.FindAssets(filename + typeSearchString);
+ foreach (string guid in guids) {
+ string currentPath = AssetDatabase.GUIDToAssetPath(guid);
+ if (!System.IO.Path.HasExtension(extensionBeforeChange)) // asmdef is also found as t:TextAsset, so check
+ continue;
+
+ string targetPath = System.IO.Path.ChangeExtension(currentPath, setActive ? "asmdef" : "txt");
+ if (System.IO.File.Exists(currentPath) && !System.IO.File.Exists(targetPath)) {
+ System.IO.File.Copy(currentPath, targetPath);
+ System.IO.File.Copy(currentPath + ".meta", targetPath + ".meta");
+ }
+ AssetDatabase.DeleteAsset(currentPath);
+ }
}
}
diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs
index 5faa97b1c..398a8b213 100644
--- a/spine-unity/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs
+++ b/spine-unity/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs
@@ -27,7 +27,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-#if UNITY_2017 || UNITY_2018
+#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
using UnityEditor;
using UnityEngine;
using UnityEngine.Playables;
@@ -53,4 +53,4 @@ public class SpineSkeletonFlipDrawer : PropertyDrawer
EditorGUI.PropertyField(singleFieldRect, flipYProp);
}
}
-#endif
+#endif
\ No newline at end of file
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity.asmdef b/spine-unity/Assets/Spine/Runtime/spine-unity.asmdef
deleted file mode 100644
index b364e160d..000000000
--- a/spine-unity/Assets/Spine/Runtime/spine-unity.asmdef
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "name": "spine-unity"
-}
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity.txt b/spine-unity/Assets/Spine/Runtime/spine-unity.txt
new file mode 100644
index 000000000..cabce6f94
--- /dev/null
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity.txt
@@ -0,0 +1,4 @@
+{
+ "name": "spine-unity",
+ "references": []
+}
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity.asmdef.meta b/spine-unity/Assets/Spine/Runtime/spine-unity.txt.meta
similarity index 100%
rename from spine-unity/Assets/Spine/Runtime/spine-unity.asmdef.meta
rename to spine-unity/Assets/Spine/Runtime/spine-unity.txt.meta
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs
index d43d4f24d..a16737d34 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs
@@ -58,7 +58,7 @@ namespace Spine.Unity.Playables {
public override Skeleton Skeleton { get { return skeletonAnimation.Skeleton; } }
public override SkeletonData SkeletonData { get { return skeletonAnimation.Skeleton.data; } }
- #if UNITY_2017 || UNITY_2018
+ #if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
void Awake () {
if (skeletonAnimation == null)
skeletonAnimation = GetComponent();
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs
index ef5fd73ca..8bafb2118 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs
@@ -27,7 +27,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-#if UNITY_2017 || UNITY_2018
+#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
using System;
using UnityEngine;
using UnityEngine.Playables;
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs
index 8b68f559f..f3b6c175d 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs
@@ -27,7 +27,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-#if UNITY_2017 || UNITY_2018
+#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
using System;
using UnityEngine;
using UnityEngine.Playables;
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs
index 35980fb38..5b12f920a 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs
@@ -29,7 +29,7 @@
#define SPINE_EDITMODEPOSE
-#if UNITY_2017 || UNITY_2018
+#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
using System;
using UnityEngine;
using UnityEngine.Playables;
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs
index 13058b8d3..a3d282227 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs
@@ -27,7 +27,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-#if UNITY_2017 || UNITY_2018
+#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs
index 749c936ec..a4eaae0ea 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs
@@ -27,7 +27,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-#if UNITY_2017 || UNITY_2018
+#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
using System;
using UnityEngine;
using UnityEngine.Playables;
@@ -37,4 +37,4 @@ using UnityEngine.Timeline;
public class SpineSkeletonFlipBehaviour : PlayableBehaviour {
public bool flipX, flipY;
}
-#endif
+#endif
\ No newline at end of file
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs
index 95bf4f808..a570758e9 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs
@@ -27,7 +27,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-#if UNITY_2017 || UNITY_2018
+#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
using System;
using UnityEngine;
using UnityEngine.Playables;
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs
index 3573b5761..33e42f3b4 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs
@@ -27,7 +27,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-#if UNITY_2017 || UNITY_2018
+#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
using System;
using UnityEngine;
using UnityEngine.Playables;
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs
index 7c8361494..efa2a5fd1 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs
@@ -27,7 +27,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-#if UNITY_2017 || UNITY_2018
+#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED)
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;