mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[unity] More robustness changes for asmdef files and Timeline support in Unity 2019, see #1326.
This commit is contained in:
parent
c6fa814c6d
commit
d9962bfb09
@ -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);
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
{
|
||||
"name": "spine-unity"
|
||||
"name": "spine-unity",
|
||||
"references": []
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user