Skip to content

Commit 7cbb4d5

Browse files
author
nebulaliu
committed
Merge branch 'main' into feat/launchOpera
2 parents 809db83 + 0d64c53 commit 7cbb4d5

File tree

79 files changed

+4862
-1148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4862
-1148
lines changed

.config/.vitepress/config.mts

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
import { defineConfig } from "vitepress";
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "微信小游戏团结/Unity快适配",
6+
description: "Wechat Mini Game Unity engine adapter documents.",
7+
themeConfig: {
8+
nav: [
9+
{ text: "主页", link: "/" },
10+
{
11+
text: "微信小游戏官方文档",
12+
link: "https://developers.weixin.qq.com/minigame/dev/guide/",
13+
},
14+
{
15+
text: "帮助",
16+
items: [
17+
{
18+
text: "微信开发者社区",
19+
link: "https://developers.weixin.qq.com/community/develop/question",
20+
},
21+
{
22+
text: "客服助手",
23+
link: "https://work.weixin.qq.com/kfid/kfcca4feec277f91616",
24+
},
25+
],
26+
},
27+
{ text: "团结引擎", link: "https://unity.cn/tuanjie/tuanjieyinqing" },
28+
],
29+
30+
sidebar: [
31+
{
32+
text: "基本",
33+
items: [
34+
{ text: "简介", link: "/README" },
35+
{ text: "安装与使用", link: "/Design/SDKInstaller" },
36+
{ text: "入门指南", link: "/Design/Guide" },
37+
{ text: "优秀案例", link: "/Design/ShowCase" },
38+
{ text: "更新日志", link: "/CHANGELOG.md" },
39+
],
40+
},
41+
{
42+
text: "方案概述与兼容性",
43+
items: [
44+
{ text: "技术原理", link: "/Design/Summary" },
45+
{ text: "兼容性评估", link: "/Design/Evaluation" },
46+
{ text: "推荐引擎版本", link: "/Design/UnityVersion" },
47+
],
48+
},
49+
{
50+
text: "性能优化",
51+
items: [
52+
{
53+
text: "性能优化总览",
54+
link: "/Design/PerfOptimization",
55+
},
56+
{
57+
text: "性能优化评估标准",
58+
link: "/Design/PerfMeasure",
59+
},
60+
{
61+
text: "启动性能",
62+
items: [
63+
{
64+
text: "提升 Unity WebGL 游戏启动速度",
65+
link: "/Design/StartupOptimization",
66+
},
67+
{ text: "启动流程与时序", link: "/Design/Startup" },
68+
{
69+
text: "使用 Loader 进行游游戏加载",
70+
link: "/Design/UsingLoader",
71+
},
72+
{ text: "资源按需加载概述", link: "/Design/ResourcesLoading" },
73+
{
74+
text: "使用 AssetBundle 进行资源按需加载",
75+
link: "/Design/UsingAssetBundle",
76+
},
77+
{
78+
text: "使用 Addressable 进行资源按需加载",
79+
link: "/Design/UsingAddressable",
80+
},
81+
{
82+
text: "使用 AutoStreaming 进行资源按需加载",
83+
link: "/Design/InstantGameGuide",
84+
},
85+
{ text: "定制启动封面", link: "/Design/CustomLoading" },
86+
{ text: "设计启动剧情", link: "/Design/LaunchOpera" },
87+
{ text: "使用预下载功能", link: "/Design/UsingPreload" },
88+
{ text: "首场景启动优化", link: "/Design/FirstSceneOptimization" },
89+
{ text: "使用代码分包工具", link: "/Design/WasmSplit" },
90+
{ text: "启动留存数据上报统计", link: "/Design/ReportStartupStat" },
91+
{ text: "最佳实践检测工具", link: "/Design/PerformanceMonitor" },
92+
{ text: "微信系统字体", link: "/Design/WXFont" },
93+
],
94+
},
95+
{
96+
text: "运行性能",
97+
items: [
98+
{ text: "优化Unity WebGL的运行性能", link: "/Design/OptimizationPerformence" },
99+
{
100+
text: "使用 Android CPU Profiler 性能调优",
101+
link: "/Design/AndroidProfile",
102+
},
103+
{
104+
text: "使用 Unity Profiler 性能调优",
105+
link: "/Design/UnityProfiler",
106+
},
107+
{ text: "优化Unity WebGL的内存", link: "/Design/OptimizationMemory" },
108+
{
109+
text: "使用ProfilingMemory分析内存",
110+
link: "/Design/UsingMemoryProfiler",
111+
},
112+
{ text: "压缩纹理优化", link: "/Design/CompressedTexture" },
113+
{ text: "资源优化工具与建议", link: "/Design/AssetOptimization" },
114+
{ text: "iOS高性能 与 高性能+ 模式", link: "/Design/iOSOptimization" },
115+
{ text: "优化Unity WebGL的渲染性能", link: "/Design/RenderOptimization" },
116+
{ text: "定制微信小游戏的 URP 管线", link: "/Design/CustomURP" },
117+
{ text: "WebGL2.0渲染支持说明", link: "/Design/WebGL2" },
118+
],
119+
},
120+
],
121+
},
122+
{
123+
text: "版本更新与资源部署",
124+
items: [
125+
{ text: "小游戏资源部署", link: "/Design/DataCDN" },
126+
{ text: "小游戏资源缓存", link: "/Design/FileCache" },
127+
{ text: "小游戏版本更新", link: "/Design/Update" },
128+
],
129+
},
130+
{
131+
text: "能力适配",
132+
items: [
133+
{ text: "WX SDK 平台能力适配", link: "/Design/WX_SDK" },
134+
{ text: "屏幕适配", link: "/Design/fixScreen" },
135+
{ text: "输入法适配", link: "/Design/InputAdaptation" },
136+
{ text: "排行榜与微信关系数据", link: "/Design/OpenData" },
137+
{ text: "后端服务指引", link: "/Design/BackendServiceStartup" },
138+
{ text: "网络通信适配", link: "/Design/UsingNetworking" },
139+
{ text: "使用水印保护代码包安全", link: "/Design/wasmWaterMark" },
140+
],
141+
},
142+
{
143+
text: "调试与异常处理",
144+
items: [
145+
{ text: "开发错误调试与排查", link: "/Design/DebugAndException" },
146+
{ text: "现网错误日志上报与排查", link: "/Design/IssueForProduction" },
147+
],
148+
},
149+
{
150+
text: "其他",
151+
items: [
152+
{ text: "技术常见问题QA", link: "/Design/DevelopmentQAList" },
153+
{ text: "问题反馈与联系我们", link: "/Design/IssueAndContact" },
154+
{ text: "技术沙龙", link: "/Design/Salon" },
155+
],
156+
},
157+
],
158+
159+
socialLinks: [
160+
{
161+
icon: "github",
162+
link: "https://github.com/wechat-miniprogram/minigame-unity-webgl-transform",
163+
},
164+
],
165+
166+
search: {
167+
provider: "local",
168+
},
169+
170+
footer: {
171+
message: 'Released under the MIT License.',
172+
copyright: 'Copyright © 2021 Tencent'
173+
}
174+
},
175+
srcDir: "../",
176+
base: "/minigame-unity-webgl-transform/",
177+
outDir: "../docs",
178+
// ignoreDeadLinks: true,
179+
lang: "zh-cn",
180+
});

.github/workflows/node.js.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
with:
20+
ref: main
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: 16
26+
27+
- name: Install dependencies
28+
run: npm install
29+
30+
- name: Build
31+
run: |
32+
rm -rf Demo
33+
npm run docs:build
34+
35+
- name: Deploy to Pages
36+
uses: peaceiris/actions-gh-pages@v3
37+
with:
38+
deploy_key: ${{ secrets.DEPLOY_KEY }}
39+
publish_dir: ./docs
40+
publish_branch: pages
41+
force_orphan: true
42+
git_config_name: nebulaliu
43+
git_config_email: [email protected]

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,9 @@ Plugins.meta
5050

5151
!minigame.texturecompressed.backup.unitypackage
5252
!minigame.202305172131.unitypackage
53-
!Demo/LaunchOpera/Assets/WebGLTemplates
53+
!Demo/LaunchOpera/Assets/WebGLTemplates
54+
55+
docs
56+
node_modules
57+
.config/.vitepress/dist
58+
.config/.vitepress/cache

CHANGELOG.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,21 @@ Removed - 删除功能/接口
66
Fixed - 修复问题
77
Others - 其他
88
-->
9-
标准版下载地址:[微信小游戏Unity转换插件](https://game.weixin.qq.com/cgi-bin/gamewxagwasmsplitwap/getunityplugininfo?download=1)
9+
SDK安装指引:[微信小游戏团结引擎转换插件WXSDK](Design/SDKInstaller.md)
1010

11-
团结版下载地址:[微信小游戏团结引擎转换插件](https://tla-1312733274.cos.ap-shanghai.myqcloud.com/InstantGame/Release/tuanjie1231/minigame.202401191135.unitypackage)
11+
## 2024-4-3 【重要更新】
12+
包含重要bugfix、特性支持
13+
### Fixed
14+
* 普通:修复UDP接口处理buffer
15+
* 重要:修复unity-namespace.js部分环境变量丢失问题
16+
17+
## 2024-3-28 【普通更新】
18+
* 普通:优化对团结版的导出支持
19+
### Fixed
20+
* 普通:兼容PlayDelayed播放
21+
* 普通:兼容FMOD2.02版本
22+
* 普通:修复FState偶现报错
23+
*
1224
## 2024-3-5 【普通更新】
1325
* 普通:WXAssetBundle支持切换CDN
1426
* 普通:优化VideoPlayer组件

Demo/API_V2/Assets/API/Audio/AudioManager.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using UnityEngine;
2-
2+
using UnityEngine.Networking;
33
public class AudioManager : MonoBehaviour
44
{
55
public AudioSource AudioSource;
@@ -39,4 +39,11 @@ public void Stop()
3939
{
4040
AudioSource.Stop();
4141
}
42+
43+
public void playDelayed()
44+
{
45+
AudioSource.clip = AudioClipLong;
46+
AudioSource.loop = true;
47+
AudioSource.PlayDelayed(3);
48+
}
4249
}

Demo/API_V2/Assets/API/Base/BaseSO.asset

+1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ MonoBehaviour:
2020
- {fileID: 11400000, guid: 29b8eb105fe9d400f9a79bdb140e85c9, type: 2}
2121
- {fileID: 11400000, guid: 3996b93c3d76d47088845abcebf960fb, type: 2}
2222
- {fileID: 11400000, guid: 9d4267fc1b8274349a253ca28e0340d7, type: 2}
23+
- {fileID: 11400000, guid: e6944788ab3d04858bc3c6cf1f2f7273, type: 2}
2324
- {fileID: 11400000, guid: e535490610e214b1cabe9378cb46ea5a, type: 2}

Demo/API_V2/Assets/API/Base/RealtimeLog.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using LitJson;
4+
using UnityEngine;
5+
using WeChatWASM;
6+
7+
public class RealtimeLog : Details
8+
{
9+
private WXRealtimeLogManager _log;
10+
11+
private void Start()
12+
{
13+
_log = WX.GetRealtimeLogManager();
14+
_log.AddFilterMsg("test");
15+
16+
GameManager.Instance.detailsController.BindExtraButtonAction(0, warn);
17+
GameManager.Instance.detailsController.BindExtraButtonAction(1, error);
18+
}
19+
20+
// 测试 API
21+
protected override void TestAPI(string[] args)
22+
{
23+
_log.Info("info msg");
24+
}
25+
26+
private void error() {
27+
_log.Error("error msg");
28+
}
29+
30+
private void warn() {
31+
_log.Warn("warn msg");
32+
}
33+
}

Demo/API_V2/Assets/script.cs.meta renamed to Demo/API_V2/Assets/API/Base/RealtimeLog/RealtimeLog.cs.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: fb48e4613a53bb941a20036d7c08fefb, type: 3}
13+
m_Name: RealtimeLogSO
14+
m_EditorClassIdentifier:
15+
entryScriptTypeName: RealtimeLog
16+
entryName: "\u5B9E\u65F6\u65E5\u5FD7"
17+
entryAPI:
18+
entryDescription:
19+
optionList: []
20+
initialButtonText: "\u4E0A\u4F20info\u65E5\u5FD7"
21+
extraButtonList:
22+
- buttonText: "\u4E0A\u4F20warn\u65E5\u5FD7"
23+
- buttonText: "\u4E0A\u4F20error\u65E5\u5FD7"
24+
initialResultList: []

Demo/API_V2/Assets/API/Base/RealtimeLog/RealtimeLogSO.asset.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)