mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Update compatibility message.
Spine 3.4 was a major launcher and editor update but required no runtime changes.
This commit is contained in:
parent
05c7cde3c0
commit
7e5aa7db2b
@ -914,7 +914,8 @@ namespace Spine.Unity.Editor {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Checking Methods
|
#region Checking Methods
|
||||||
static int[] runtimeVersion = { 3, 3 };
|
static int[][] compatibleVersions = { new[] {3, 4, 0}, new[] {3, 3, 0} };
|
||||||
|
static bool isFixVersionRequired = false;
|
||||||
|
|
||||||
static bool CheckForValidSkeletonData (string skeletonJSONPath) {
|
static bool CheckForValidSkeletonData (string skeletonJSONPath) {
|
||||||
string dir = Path.GetDirectoryName(skeletonJSONPath);
|
string dir = Path.GetDirectoryName(skeletonJSONPath);
|
||||||
@ -953,13 +954,27 @@ namespace Spine.Unity.Editor {
|
|||||||
// Version warning
|
// Version warning
|
||||||
{
|
{
|
||||||
var skeletonInfo = (Dictionary<string, object>)root["skeleton"];
|
var skeletonInfo = (Dictionary<string, object>)root["skeleton"];
|
||||||
string spineVersion = (string)skeletonInfo["spine"];
|
string jsonVersion = (string)skeletonInfo["spine"];
|
||||||
if (!string.IsNullOrEmpty(spineVersion)) {
|
if (!string.IsNullOrEmpty(jsonVersion)) {
|
||||||
var splitVersion = spineVersion.Split('.');
|
string[] jsonVersionSplit = jsonVersion.Split('.');
|
||||||
bool primaryMismatch = runtimeVersion[0] != int.Parse(splitVersion[0]);
|
bool match = false;
|
||||||
bool secondaryMismatch = runtimeVersion[1] != int.Parse(splitVersion[1]);
|
foreach (var version in compatibleVersions) {
|
||||||
if (primaryMismatch || secondaryMismatch)
|
bool primaryMatch = version[0] == int.Parse(jsonVersionSplit[0]);
|
||||||
Debug.LogWarning(string.Format("Skeleton '{0}' (exported with Spine {1}) may be incompatible with your runtime version: spine-unity v{2}", asset.name, spineVersion, runtimeVersion[0] + "." + runtimeVersion[1]));
|
bool secondaryMatch = version[1] == int.Parse(jsonVersionSplit[1]);
|
||||||
|
|
||||||
|
if (isFixVersionRequired)
|
||||||
|
secondaryMatch &= version[2] <= int.Parse(jsonVersionSplit[2]);
|
||||||
|
|
||||||
|
if (primaryMatch && secondaryMatch) {
|
||||||
|
match = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!match) {
|
||||||
|
string runtimeVersion = compatibleVersions[0][0] + "." + compatibleVersions[0][1];
|
||||||
|
Debug.LogWarning(string.Format("Skeleton '{0}' (exported with Spine {1}) may be incompatible with your runtime version: spine-unity v{2}", asset.name, jsonVersion, runtimeVersion));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user