Skip to content

Commit

Permalink
Auto-publish WXSDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
M1Pro authored and M1Pro committed Mar 29, 2024
1 parent fe8d29e commit 947e902
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
19 changes: 15 additions & 4 deletions Editor/WXConvertCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ public static void Init()
PlayerSettings.WeixinMiniGame.threadsSupport = false;
PlayerSettings.runInBackground = false;
PlayerSettings.WeixinMiniGame.compressionFormat = WeixinMiniGameCompressionFormat.Disabled;
PlayerSettings.WeixinMiniGame.template = $"{templateHeader}WXTemplate2022TJ";
if(UnityUtil.GetEngineVersion() == UnityUtil.EngineVersion.Tuanjie)
{
var absolutePath = Path.GetFullPath("Packages/com.qq.weixin.minigame/WebGLTemplates/WXTemplate2022TJ");
PlayerSettings.WeixinMiniGame.template = $"PATH:{absolutePath}";
}
else
{
PlayerSettings.WeixinMiniGame.template = $"{templateHeader}WXTemplate2022TJ";
}
PlayerSettings.WeixinMiniGame.linkerTarget = WeixinMiniGameLinkerTarget.Wasm;
PlayerSettings.WeixinMiniGame.dataCaching = false;
PlayerSettings.WeixinMiniGame.debugSymbolMode = WeixinMiniGameDebugSymbolMode.External;
Expand Down Expand Up @@ -497,7 +505,7 @@ function pathToFileURL(path) {

private static void ConvertCode()
{
UnityEngine.Debug.LogFormat("[Converter] Starting to adapt framewor. Dst: " + config.ProjectConf.DST);
UnityEngine.Debug.LogFormat("[Converter] Starting to adapt framework. Dst: " + config.ProjectConf.DST);

UnityUtil.DelectDir(Path.Combine(config.ProjectConf.DST, miniGameDir));
string text = String.Empty;
Expand Down Expand Up @@ -611,8 +619,11 @@ private static void ConvertCode()
}

text = header + text;

var targetPath = Path.Combine(config.ProjectConf.DST, miniGameDir, target);
if (!UseIL2CPP)
{
targetPath = Path.Combine(config.ProjectConf.DST, miniGameDir, frameworkDir, target);
Rule[] nativeRules =
{
new Rule()
Expand Down Expand Up @@ -654,7 +665,7 @@ private static void ConvertCode()
}
}

File.WriteAllText(Path.Combine(config.ProjectConf.DST, miniGameDir, target), text, new UTF8Encoding(false));
File.WriteAllText(targetPath, text, new UTF8Encoding(false));

UnityEngine.Debug.LogFormat("[Converter] adapt framework done! ");
}
Expand Down Expand Up @@ -1572,4 +1583,4 @@ public static bool ShowMatchFailedWarning(string text, string rule, string file)
}
}

}
}
5 changes: 1 addition & 4 deletions Editor/WXEditorSettingHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ public class WXSettingsHelper
public WXSettingsHelper()
{
Type weixinMiniGamePackageHelpersType = Type.GetType("UnityEditor.WeixinPackageHelpers,UnityEditor");
if (weixinMiniGamePackageHelpersType == null)
{
weixinMiniGamePackageHelpersType = Type.GetType("UnityEditor.WeixinMiniGamePackageHelpers,UnityEditor");
}
if (weixinMiniGamePackageHelpersType != null)
{
EventInfo onSettingsGUIEvent = weixinMiniGamePackageHelpersType.GetEvent("OnPackageSettingsGUI");
Expand Down Expand Up @@ -77,6 +73,7 @@ public void OnDisable()
public Texture tex;
public void OnSettingsGUI(EditorWindow window)
{
PluginUpdateManager.CheckUpdateOnce();
scrollRoot = EditorGUILayout.BeginScrollView(scrollRoot);

GUIStyle linkStyle = new GUIStyle(GUI.skin.label);
Expand Down
2 changes: 0 additions & 2 deletions Editor/WXEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public static void Open()
win.minSize = new Vector2(350, 400);
win.position = new Rect(100, 100, 600, 700);
win.Show();
// 打开面板时自动检查更新
PluginUpdateManager.CheckUpdte();
}

// 向前兼容,请使用 WXConvertCore.cs
Expand Down
2 changes: 1 addition & 1 deletion Editor/WXPluginVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class WXPluginVersion
{
public static string pluginVersion = "202403281934"; // 这一行不要改他,导出的时候会自动替换
public static string pluginVersion = "202403291954"; // 这一行不要改他,导出的时候会自动替换
}

public class WXPluginConf
Expand Down
Binary file modified Editor/wx-editor.dll
Binary file not shown.
Binary file modified Runtime/Plugins/wx-runtime-editor.dll
Binary file not shown.
Binary file modified Runtime/Plugins/wx-runtime.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"com.qq.weixin.minigame","displayName":"WXSDK","description":"WeChat Mini Game Tuanjie Engine Adapter SDK Package.","version":"0.1.5","unity":"2019.4","unityRelease":"29f1","keywords":["Tuanjie","WX"],"dependencies":{}}
{"name":"com.qq.weixin.minigame","displayName":"WXSDK","description":"WeChat Mini Game Tuanjie Engine Adapter SDK Package.","version":"0.1.6","unity":"2019.4","unityRelease":"29f1","keywords":["Tuanjie","WX"],"dependencies":{}}

0 comments on commit 947e902

Please sign in to comment.