improve build scripts

This commit is contained in:
2026-01-06 21:51:31 +01:00
parent 8423e2b790
commit 899d7e6691
6 changed files with 32 additions and 6 deletions

View File

@@ -29,7 +29,8 @@ public class AndroidPostProcess : IPostGenerateGradleAndroidProject
// 4. Prepare the command
string commandName = "my_plugin_build";
string lineToAdd = $"\nadd_subdirectory(\"{relativePathToMyCpp}\" \"{commandName}\")\n";
string unityRoot = EditorApplication.applicationContentsPath;
string lineToAdd = $"\nset(UNITY_ROOT \"{unityRoot}\")\nadd_subdirectory(\"{relativePathToMyCpp}\" \"{commandName}\")\n";
// 5. Prevent multiple additions
string currentContent = File.ReadAllText(targetCmakeFile);