[unity] More robustness changes for asmdef files and Timeline support in Unity 2019, see #1326.

This commit is contained in:
Harald Csaszar 2019-04-30 19:58:00 +02:00
parent c6fa814c6d
commit d9962bfb09
2 changed files with 13 additions and 2 deletions

View File

@ -1937,6 +1937,9 @@ namespace Spine.Unity.Editor {
internal static void HandleSuccessfulTimelinePackageDownload () {
#if !SPINE_TK2D
SpineBuildEnvUtility.EnableSpineAsmdefFiles();
#endif
SpineBuildEnvUtility.AddDependencyToAsmdefFile(TIMELINE_ASMDEF_DEPENDENCY_STRING);
SpineBuildEnvUtility.EnableBuildDefine(SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE);
}
@ -2030,7 +2033,14 @@ namespace Spine.Unity.Editor {
if (System.IO.File.Exists(filePath)) {
string fileContent = File.ReadAllText(filePath);
// this simple implementation shall suffice for now.
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);

View File

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