浏览代码

Merge branch '3.7' of https://github.com/esotericsoftware/spine-runtimes into 3.7

badlogic 6 年之前
父节点
当前提交
cd22ab91cb
共有 17 个文件被更改,包括 284 次插入77 次删除
  1. 9 1
      CHANGELOG.md
  2. 0 0
      spine-unity/Assets/Spine/Editor/spine-unity-editor.txt
  3. 0 0
      spine-unity/Assets/Spine/Editor/spine-unity-editor.txt.meta
  4. 259 61
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs
  5. 2 2
      spine-unity/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs
  6. 0 3
      spine-unity/Assets/Spine/Runtime/spine-unity.asmdef
  7. 4 0
      spine-unity/Assets/Spine/Runtime/spine-unity.txt
  8. 0 0
      spine-unity/Assets/Spine/Runtime/spine-unity.txt.meta
  9. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs
  10. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs
  11. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs
  12. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs
  13. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs
  14. 2 2
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs
  15. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs
  16. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs
  17. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs

+ 9 - 1
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`

+ 0 - 0
spine-unity/Assets/Spine/Editor/spine-unity-editor.asmdef → spine-unity/Assets/Spine/Editor/spine-unity-editor.txt


+ 0 - 0
spine-unity/Assets/Spine/Editor/spine-unity-editor.asmdef.meta → spine-unity/Assets/Spine/Editor/spine-unity-editor.txt.meta


+ 259 - 61
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,94 +1806,274 @@ 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 () {
+				SpineBuildEnvUtility.DisableSpineAsmdefFiles();
+				SpineBuildEnvUtility.EnableBuildDefine(SPINE_TK2D_DEFINE);
 			}
 
-			internal static void EnableTK2D () {
-				bool added = false;
+			internal static void DisableTK2D () {
+				SpineBuildEnvUtility.EnableSpineAsmdefFiles();
+				SpineBuildEnvUtility.DisableBuildDefine(SPINE_TK2D_DEFINE);
+			}
+		}
 
-				DisableSpineAsmdefFiles();
+		public static class SpinePackageDependencyUtility
+		{
+			public enum RequestState {
+				NoRequestIssued = 0,
+				InProgress,
+				Success,
+				Failure
+			}
+
+			#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;
+			
+			/// <summary>
+			/// Enables Spine's Timeline components by downloading the Timeline Package in Unity 2019 and newer
+			/// and setting respective compile definitions once downloaded.
+			/// </summary>
+			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.
 
-				foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) {
-					if (IsInvalidGroup(group))
-						continue;
+				EditorApplication.update -= UpdateAsyncTimelineRequest;
+				EditorApplication.update += UpdateAsyncTimelineRequest;
+			}
 
-					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;
+			public static void UpdateAsyncTimelineRequest () {
+				HandlePendingAsyncTimelineRequest();
+			}
+
+			public static RequestState HandlePendingAsyncTimelineRequest () {
+				if (timelineRequest == null)
+					return RequestState.NoRequestIssued;
 
-						PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines);
+				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 (added) {
-					Debug.LogWarning("Setting Scripting Define Symbol " + SPINE_TK2D_DEFINE);
-				} else {
-					Debug.LogWarning("Already Set Scripting Define Symbol " + SPINE_TK2D_DEFINE);
+			internal static void DisableTimelineSupport () {
+				SpineBuildEnvUtility.DisableBuildDefine(SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE);
+				SpineBuildEnvUtility.RemoveDependencyFromAsmdefFile(TIMELINE_ASMDEF_DEPENDENCY_STRING);
+			}
+
+			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 ReimportTimelineScripts () {
+				// Note: unfortunately AssetDatabase::Refresh is not enough and
+				// ImportAsset on a dir does not have the desired effect.
+				List<string> searchStrings = new List<string>();
+				searchStrings.Add("SpineAnimationStateBehaviour t:script");
+				searchStrings.Add("SpineAnimationStateClip t:script");
+				searchStrings.Add("SpineAnimationStateMixerBehaviour t:script");
+				searchStrings.Add("SpineAnimationStateTrack t:script");
+
+				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);
+					}
 				}
 			}
+			#endif
+		}
+	}
 
+	public static class SpineBuildEnvUtility
+	{
+		static bool IsInvalidGroup (BuildTargetGroup group) {
+			int gi = (int)group;
+			return
+				gi == 15 || gi == 16
+				||
+				group == BuildTargetGroup.Unknown;
+		}
 
-			internal static void DisableTK2D () {
-				bool removed = false;
+		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;
 
-				EnableSpineAsmdefFiles();
+				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");
 
-				foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) {
-					if (IsInvalidGroup(group))
-						continue;
+			if (wasDefineAdded) {
+				Debug.LogWarning("Setting Scripting Define Symbol " + define);
+			}
+			else {
+				Debug.LogWarning("Already Set Scripting Define Symbol " + define);
+			}
+			return wasDefineAdded;
+		}
 
-					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, "");
+		public static bool DisableBuildDefine (string define) {
+			
+			bool wasDefineRemoved = false;
+			foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) {
+				if (IsInvalidGroup(group))
+					continue;
 
-						PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines);
-					}
+				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 (removed) {
-					Debug.LogWarning("Removing Scripting Define Symbol " + SPINE_TK2D_DEFINE);
-				} else {
-					Debug.LogWarning("Already Removed Scripting Define Symbol " + SPINE_TK2D_DEFINE);
+			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;
 
-			internal static void DisableSpineAsmdefFiles() {
-				SetAsmdefFileActive("spine-unity-editor", false);
-				SetAsmdefFileActive("spine-unity", false);
+			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) {
 
-			internal static void EnableSpineAsmdefFiles() {
-				SetAsmdefFileActive("spine-unity-editor", true);
-				SetAsmdefFileActive("spine-unity", true);
+			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) {
+		internal static void SetAsmdefFileActive (string filename, bool setActive) {
 
-				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");
-					}
-					AssetDatabase.DeleteAsset(currentPath);
+			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);
 			}
 		}
 	}

+ 2 - 2
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

+ 0 - 3
spine-unity/Assets/Spine/Runtime/spine-unity.asmdef

@@ -1,3 +0,0 @@
-{
-	"name": "spine-unity"
-}

+ 4 - 0
spine-unity/Assets/Spine/Runtime/spine-unity.txt

@@ -0,0 +1,4 @@
+{
+	"name": "spine-unity",
+	"references": []
+}

+ 0 - 0
spine-unity/Assets/Spine/Runtime/spine-unity.asmdef.meta → spine-unity/Assets/Spine/Runtime/spine-unity.txt.meta


+ 1 - 1
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<SkeletonAnimation>();

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 2
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

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;