微信小程序编译
All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 13s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 17s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 35s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 15s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 33s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 5s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 15s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 2s
Plugin Library CI / publish (12.WeixinMinigame) (push) Successful in 2m32s
All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 13s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 17s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 35s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 15s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 33s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 5s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 15s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 2s
Plugin Library CI / publish (12.WeixinMinigame) (push) Successful in 2m32s
This commit is contained in:
170
Assets/12.WeixinMinigame/Editor/WXExtDef.cs
Normal file
170
Assets/12.WeixinMinigame/Editor/WXExtDef.cs
Normal file
@@ -0,0 +1,170 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
|
||||
namespace WeChatWASM
|
||||
{
|
||||
// WX-EXT-DEF
|
||||
[InitializeOnLoad]
|
||||
public class WXExtDef
|
||||
{
|
||||
static WXExtDef()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
private static void Init()
|
||||
{
|
||||
WXExtEnvDef.pluginVersion = WXPluginVersion.pluginVersion;
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
WXExtEnvDef.SETDEF("UNITY_2018_1_OR_NEWER", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_2018_1_OR_NEWER", false);
|
||||
#endif
|
||||
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
WXExtEnvDef.SETDEF("UNITY_2020_1_OR_NEWER", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_2020_1_OR_NEWER", false);
|
||||
#endif
|
||||
|
||||
#if UNITY_2021_1_OR_NEWER
|
||||
WXExtEnvDef.SETDEF("UNITY_2021_1_OR_NEWER", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_2021_1_OR_NEWER", false);
|
||||
#endif
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
WXExtEnvDef.SETDEF("UNITY_2021_2_OR_NEWER", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_2021_2_OR_NEWER", false);
|
||||
#endif
|
||||
#if UNITY_2021_3_OR_NEWER
|
||||
WXExtEnvDef.SETDEF("UNITY_2021_3_OR_NEWER", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_2021_3_OR_NEWER", false);
|
||||
#endif
|
||||
#if UNITY_EDITOR_OSX
|
||||
WXExtEnvDef.SETDEF("UNITY_EDITOR_OSX", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_EDITOR_OSX", false);
|
||||
#endif
|
||||
#if UNITY_EDITOR_LINUX
|
||||
WXExtEnvDef.SETDEF("UNITY_EDITOR_LINUX", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_EDITOR_LINUX", false);
|
||||
#endif
|
||||
#if UNITY_2020
|
||||
WXExtEnvDef.SETDEF("UNITY_2020", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_2020", false);
|
||||
#endif
|
||||
#if UNITY_2021
|
||||
WXExtEnvDef.SETDEF("UNITY_2021", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_2021", false);
|
||||
#endif
|
||||
#if UNITY_2022
|
||||
WXExtEnvDef.SETDEF("UNITY_2022", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_2022", false);
|
||||
#endif
|
||||
#if UNITY_6000
|
||||
WXExtEnvDef.SETDEF("UNITY_6000", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_6000", false);
|
||||
#endif
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
WXExtEnvDef.SETDEF("UNITY_2022_2_OR_NEWER", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_2022_2_OR_NEWER", false);
|
||||
#endif
|
||||
#if UNITY_INSTANTGAME
|
||||
WXExtEnvDef.SETDEF("UNITY_INSTANTGAME", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_INSTANTGAME", false);
|
||||
#endif
|
||||
#if WEIXINMINIGAME
|
||||
WXExtEnvDef.SETDEF("WEIXINMINIGAME", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("WEIXINMINIGAME", false);
|
||||
#endif
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
WXExtEnvDef.SETDEF("TUANJIE_2022_3_OR_NEWER", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("TUANJIE_2022_3_OR_NEWER", false);
|
||||
#endif
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
WXExtEnvDef.SETDEF("UNITY_6000_0_OR_NEWER", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("UNITY_6000_0_OR_NEWER", false);
|
||||
#endif
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
WXExtEnvDef.SETDEF("PLATFORM_WEIXINMINIGAME", true);
|
||||
#else
|
||||
WXExtEnvDef.SETDEF("PLATFORM_WEIXINMINIGAME", false);
|
||||
#endif
|
||||
RegisterController();
|
||||
}
|
||||
|
||||
private static void RegisterController()
|
||||
{
|
||||
// WXExtEnvDef.RegisterAction("WXEditorWindow.Init", (args) =>
|
||||
// {
|
||||
// #if UNITY_2021_2_OR_NEWER
|
||||
// PlayerSettings.WebGL.debugSymbolMode = WebGLDebugSymbolMode.External;
|
||||
// #else
|
||||
// PlayerSettings.WebGL.debugSymbols = true;
|
||||
// #endif
|
||||
// return null;
|
||||
// });
|
||||
WXExtEnvDef.RegisterAction("WXConvertCore.UseIL2CPP", (args) =>
|
||||
{
|
||||
return WXConvertCore.UseIL2CPP;
|
||||
});
|
||||
WXExtEnvDef.RegisterAction("WXConvertCore.UseiOSMetal", (args) =>
|
||||
{
|
||||
return WXConvertCore.UseiOSMetal;
|
||||
});
|
||||
WXExtEnvDef.RegisterAction("WXConvertCore.UseEmscriptenGLX", (args) =>
|
||||
{
|
||||
return WXConvertCore.UseEmscriptenGLX;
|
||||
});
|
||||
WXExtEnvDef.RegisterAction("UnityUtil.GetWxSDKRootPath", (args) =>
|
||||
{
|
||||
#if UNITY_2018
|
||||
return Path.Combine(Application.dataPath, "WX-WASM-SDK-V2");
|
||||
#else
|
||||
var packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssembly(typeof(WXExtEnvDef).Assembly);
|
||||
if (packageInfo == null)
|
||||
{
|
||||
return Path.Combine(Application.dataPath, "WX-WASM-SDK-V2");
|
||||
}
|
||||
string packagePath = packageInfo.assetPath;
|
||||
if (packageInfo.name == "WXSDK")
|
||||
{
|
||||
packagePath += "/Resources";
|
||||
}
|
||||
DirectoryInfo dir = new DirectoryInfo(packagePath);
|
||||
return dir.FullName;
|
||||
#endif
|
||||
});
|
||||
WXExtEnvDef.RegisterAction("UnityUtil.IsAssets", (args) =>
|
||||
{
|
||||
#if UNITY_2018
|
||||
return true;
|
||||
#else
|
||||
var packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssembly(typeof(WXExtEnvDef).Assembly);
|
||||
if (packageInfo == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user