@@ -208,14 +208,22 @@ private static void DoBuildAndroid(String buildPath, bool isPlugin, bool isRelea
208
208
// remove this line if you don't use a debugger and you want to speed up the flutter build
209
209
playerOptions . options = BuildOptions . AllowDebugging | BuildOptions . Development ;
210
210
}
211
- #if UNITY_2022_1_OR_NEWER
211
+ #if UNITY_6000_0_OR_NEWER
212
+ PlayerSettings . SetIl2CppCompilerConfiguration ( UnityEditor . Build . NamedBuildTarget . Android , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
213
+ PlayerSettings . SetIl2CppCodeGeneration ( UnityEditor . Build . NamedBuildTarget . Android , UnityEditor . Build . Il2CppCodeGeneration . OptimizeSize ) ;
214
+ #elif UNITY_2022_1_OR_NEWER
212
215
PlayerSettings . SetIl2CppCompilerConfiguration ( BuildTargetGroup . Android , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
213
216
PlayerSettings . SetIl2CppCodeGeneration ( UnityEditor . Build . NamedBuildTarget . Android , UnityEditor . Build . Il2CppCodeGeneration . OptimizeSize ) ;
214
217
#elif UNITY_2021_2_OR_NEWER
215
218
PlayerSettings . SetIl2CppCompilerConfiguration ( BuildTargetGroup . Android , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
216
219
EditorUserBuildSettings . il2CppCodeGeneration = UnityEditor . Build . Il2CppCodeGeneration . OptimizeSize ;
217
220
#endif
218
221
222
+
223
+ #if UNITY_ANDROID && UNITY_6000_0_OR_NEWER
224
+ UnityEditor . Android . UserBuildSettings . DebugSymbols . level = isReleaseBuild ? Unity . Android . Types . DebugSymbolLevel . None : Unity . Android . Types . DebugSymbolLevel . SymbolTable ;
225
+ UnityEditor . Android . UserBuildSettings . DebugSymbols . format = Unity . Android . Types . DebugSymbolFormat . LegacyExtensions ;
226
+ #endif
219
227
// Switch to Android standalone build.
220
228
EditorUserBuildSettings . SwitchActiveBuildTarget ( BuildTargetGroup . Android , BuildTarget . Android ) ;
221
229
// build addressable
@@ -227,6 +235,13 @@ private static void DoBuildAndroid(String buildPath, bool isPlugin, bool isRelea
227
235
228
236
Copy ( buildPath , AndroidExportPath ) ;
229
237
238
+ // Unity 6000 shared folder
239
+ string sharedPath = Path . Combine ( APKPath , "shared" ) ;
240
+ if ( Directory . Exists ( sharedPath ) )
241
+ {
242
+ Copy ( sharedPath , Path . Combine ( AndroidExportPath , "shared" ) ) ;
243
+ }
244
+
230
245
// Modify build.gradle
231
246
ModifyAndroidGradle ( isPlugin ) ;
232
247
@@ -332,6 +347,10 @@ private static void ModifyAndroidGradle(bool isPlugin)
332
347
buildText = buildText . Replace ( " + unityStreamingAssets.tokenize(', ')" , "" ) ;
333
348
buildText = Regex . Replace ( buildText , "ndkPath \" .*\" " , "" ) ;
334
349
350
+ // Untiy 6000, handle ../shared/
351
+ buildText = Regex . Replace ( buildText , @"\.\./shared/" , "./shared/" ) ;
352
+
353
+
335
354
// check for namespace definition (Android gradle plugin 8+), add a backwards compatible version if it is missing.
336
355
if ( ! buildText . Contains ( "namespace" ) )
337
356
{
@@ -404,7 +423,10 @@ private static void BuildIOS(String path, bool isReleaseBuild)
404
423
EditorUserBuildSettings . iOSBuildConfigType = iOSBuildType . Release ;
405
424
#endif
406
425
407
- #if UNITY_2022_1_OR_NEWER
426
+ #if UNITY_6000_0_OR_NEWER
427
+ PlayerSettings . SetIl2CppCompilerConfiguration ( UnityEditor . Build . NamedBuildTarget . Android , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
428
+ PlayerSettings . SetIl2CppCodeGeneration ( UnityEditor . Build . NamedBuildTarget . Android , UnityEditor . Build . Il2CppCodeGeneration . OptimizeSize ) ;
429
+ #elif UNITY_2022_1_OR_NEWER
408
430
PlayerSettings . SetIl2CppCompilerConfiguration ( BuildTargetGroup . iOS , isReleaseBuild ? Il2CppCompilerConfiguration . Release : Il2CppCompilerConfiguration . Debug ) ;
409
431
PlayerSettings . SetIl2CppCodeGeneration ( UnityEditor . Build . NamedBuildTarget . iOS , UnityEditor . Build . Il2CppCodeGeneration . OptimizeSize ) ;
410
432
#elif UNITY_2021_2_OR_NEWER
0 commit comments