@@ -28,7 +28,7 @@ public static void Init()
2828 SDKFilePath = Path . Combine ( UnityUtil . GetWxSDKRootPath ( ) , "Runtime" , "wechat-default" , "unity-sdk" , "index.js" ) ;
2929 // string templateHeader = (UnityUtil.GetSDKMode() == UnityUtil.SDKMode.Package && UnityUtil.GetEngineVersion() >= UnityUtil.EngineVersion.Tuanjie) ? "PACKAGE:com.qq.wx.minigame:" : "PROJECT:";
3030 string templateHeader = "PROJECT:" ;
31- #if WEIXINMINIGAME
31+ #if PLATFORM_WEIXINMINIGAME
3232 PlayerSettings . WeixinMiniGame . threadsSupport = false ;
3333 PlayerSettings . runInBackground = false ;
3434 PlayerSettings . WeixinMiniGame . compressionFormat = WeixinMiniGameCompressionFormat . Disabled ;
@@ -177,7 +177,7 @@ private static void CheckBuildTarget()
177177 public static void UpdateGraphicAPI ( )
178178 {
179179 GraphicsDeviceType [ ] targets = new GraphicsDeviceType [ ] { } ;
180- #if WEIXINMINIGAME
180+ #if PLATFORM_WEIXINMINIGAME
181181 PlayerSettings . SetUseDefaultGraphicsAPIs ( BuildTarget . WeixinMiniGame , false ) ;
182182 if ( config . CompileOptions . Webgl2 )
183183 {
@@ -281,7 +281,7 @@ private static void ConvertCode()
281281 {
282282 text = RemoveFunctionsWithPrefix ( text , prefix ) ;
283283 }
284- #if WEIXINMINIGAME
284+ #if PLATFORM_WEIXINMINIGAME
285285 if ( PlayerSettings . WeixinMiniGame . exceptionSupport == WeixinMiniGameExceptionSupport . None )
286286#else
287287 if ( PlayerSettings . WebGL . exceptionSupport == WebGLExceptionSupport . None )
@@ -354,7 +354,7 @@ private static void ConvertCode()
354354
355355 private static int Build ( )
356356 {
357- #if WEIXINMINIGAME
357+ #if PLATFORM_WEIXINMINIGAME
358358 PlayerSettings . WeixinMiniGame . emscriptenArgs = string . Empty ;
359359 if ( WXExtEnvDef . GETDEF ( "UNITY_2021_2_OR_NEWER" ) )
360360 {
@@ -383,14 +383,14 @@ private static int Build()
383383 {
384384 UnityEngine . Debug . LogWarningFormat ( $ "UnityHeap大于500M时,32位Android与iOS普通模式较大概率启动失败,中轻度游戏建议小于该值。请查看GIT文档<a href=\" https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/blob/main/Design/OptimizationMemory.md\" >优化Unity WebGL的内存</a>") ;
385385 }
386- #if WEIXINMINIGAME
386+ #if PLATFORM_WEIXINMINIGAME
387387 PlayerSettings . WeixinMiniGame . emscriptenArgs += $ " -s TOTAL_MEMORY={ config . ProjectConf . MemorySize } MB";
388388#else
389389 PlayerSettings . WebGL . emscriptenArgs += $ " -s TOTAL_MEMORY={ config . ProjectConf . MemorySize } MB";
390390#endif
391391 }
392392
393- #if WEIXINMINIGAME
393+ #if PLATFORM_WEIXINMINIGAME
394394 if ( config . CompileOptions . ProfilingMemory )
395395 {
396396 PlayerSettings . WeixinMiniGame . emscriptenArgs += " --memoryprofiler " ;
@@ -1201,7 +1201,7 @@ private static void SettingWXTextureMinJSLib()
12011201 {
12021202 var importer = AssetImporter . GetAtPath ( jsLibs [ i ] ) as PluginImporter ;
12031203 bool value = i == index ;
1204- #if WEIXINMINIGAME
1204+ #if PLATFORM_WEIXINMINIGAME
12051205 importer . SetCompatibleWithPlatform ( BuildTarget . WeixinMiniGame , value ) ;
12061206#else
12071207 importer . SetCompatibleWithPlatform ( BuildTarget . WebGL , value ) ;
0 commit comments