diff --git a/spine-unity/Assets/Spine Examples/package.json b/spine-unity/Assets/Spine Examples/package.json new file mode 100644 index 000000000..3924c88d6 --- /dev/null +++ b/spine-unity/Assets/Spine Examples/package.json @@ -0,0 +1,20 @@ +{ + "name": "com.esotericsoftware.spine.spine-unity-examples", + "displayName": "spine-unity Runtime Examples", + "description": "This plugin provides example scenes and scripts for the spine-unity runtime.", + "version": "3.8.0", + "unity": "2018.3", + "author": { + "name": "Esoteric Software", + "email": "contact@esotericsoftware.com", + "url": "http://esotericsoftware.com/" + }, + "dependencies": { + "com.esotericsoftware.spine.spine-unity": "3.8.0" + }, + "keywords": [ + "spine", + "spine-unity", + "core" + ] +} diff --git a/spine-unity/Assets/Spine Examples/package.json.meta b/spine-unity/Assets/Spine Examples/package.json.meta new file mode 100644 index 000000000..9c5cdb952 --- /dev/null +++ b/spine-unity/Assets/Spine Examples/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3344f01d63135c94e81d853f56d6c4e5 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/spine-unity/Assets/Spine Examples/spine-unity-examples.asmdef b/spine-unity/Assets/Spine Examples/spine-unity-examples.asmdef new file mode 100644 index 000000000..646178423 --- /dev/null +++ b/spine-unity/Assets/Spine Examples/spine-unity-examples.asmdef @@ -0,0 +1,4 @@ +{ + "name": "spine-unity-examples", + "references": [ "spine-unity" ] +} diff --git a/spine-unity/Assets/Spine Examples/spine-unity-examples.asmdef.meta b/spine-unity/Assets/Spine Examples/spine-unity-examples.asmdef.meta new file mode 100644 index 000000000..f8dc4a556 --- /dev/null +++ b/spine-unity/Assets/Spine Examples/spine-unity-examples.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8f5163e4753269348a069fd2fedcba29 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs index 3ce03b128..db9605dc2 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs @@ -30,7 +30,10 @@ using System.Collections.Generic; using System.IO; using UnityEngine; +#if UNITY_EDITOR using System.Globalization; +using System.Text.RegularExpressions; +#endif namespace Spine.Unity { @@ -41,6 +44,7 @@ namespace Spine.Unity { static readonly int[][] compatibleJsonVersions = { new[] { 3, 9, 0 }, new[] { 3, 8, 0 } }; static bool wasVersionDialogShown = false; + static readonly Regex jsonVersionRegex = new Regex(@"""spine""\s*:\s*""([^""]+)""", RegexOptions.CultureInvariant); #endif public enum SourceType { @@ -92,23 +96,29 @@ namespace Spine.Unity { } } else { - object obj = Json.Deserialize(new StringReader(asset.text)); - if (obj == null) { - Debug.LogErrorFormat("'{0}' is not valid JSON.", asset.name); - return null; + Match match = jsonVersionRegex.Match(asset.text); + if (match != null) { + fileVersion.rawVersion = match.Groups[1].Value; } + else { + object obj = Json.Deserialize(new StringReader(asset.text)); + if (obj == null) { + Debug.LogErrorFormat("'{0}' is not valid JSON.", asset.name); + return null; + } - var root = obj as Dictionary; - if (root == null) { - Debug.LogErrorFormat("'{0}' is not compatible JSON. Parser returned an incorrect type while parsing version info.", asset.name); - return null; - } + var root = obj as Dictionary; + if (root == null) { + Debug.LogErrorFormat("'{0}' is not compatible JSON. Parser returned an incorrect type while parsing version info.", asset.name); + return null; + } - if (root.ContainsKey("skeleton")) { - var skeletonInfo = (Dictionary)root["skeleton"]; - object jv; - skeletonInfo.TryGetValue("spine", out jv); - fileVersion.rawVersion = jv as string; + if (root.ContainsKey("skeleton")) { + var skeletonInfo = (Dictionary)root["skeleton"]; + object jv; + skeletonInfo.TryGetValue("spine", out jv); + fileVersion.rawVersion = jv as string; + } } } diff --git a/spine-unity/Assets/Spine/package.json b/spine-unity/Assets/Spine/package.json new file mode 100644 index 000000000..6fac1264d --- /dev/null +++ b/spine-unity/Assets/Spine/package.json @@ -0,0 +1,19 @@ +{ + "name": "com.esotericsoftware.spine.spine-unity", + "displayName": "spine-unity Runtime", + "description": "This plugin provides the spine-unity runtime core.", + "version": "3.8.0", + "unity": "2018.3", + "author": { + "name": "Esoteric Software", + "email": "contact@esotericsoftware.com", + "url": "http://esotericsoftware.com/" + }, + "dependencies": { + }, + "keywords": [ + "spine", + "spine-unity", + "core" + ] +} diff --git a/spine-unity/Assets/Spine/package.json.meta b/spine-unity/Assets/Spine/package.json.meta new file mode 100644 index 000000000..d0000ccae --- /dev/null +++ b/spine-unity/Assets/Spine/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 09478c42aa0375347898d942d287a819 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: