File tree 1 file changed +21
-2
lines changed
1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
调用` Unity SDK ` 前,需要在主入口进行SDK初始化,回调后再执行主逻辑。
6
6
7
- ```
7
+ ``` csharp
8
8
WX .InitSDK ((int code )=> {
9
9
// 你的主逻辑
10
10
});
@@ -18,7 +18,26 @@ WX.InitSDK((int code)=> {
18
18
19
19
### 更新机制
20
20
21
- 新版` Unity SDK ` 会在[ lib.wx.api.d.ts] ( https://github.com/wechat-miniprogram/minigame-api-typings/blob/master/types/wx/lib.wx.api.d.ts ) 更新后及时更新。若基础库更新后[ lib.wx.api.d.ts] ( https://github.com/wechat-miniprogram/minigame-api-typings/blob/master/types/wx/lib.wx.api.d.ts ) 暂未更新,开发者可参考[ 自定义SDK调用] ( ./CustomSDK.md ) 临时调用WXSDK。
21
+ 新版` Unity SDK ` 会在[ lib.wx.api.d.ts] ( https://github.com/wechat-miniprogram/minigame-api-typings/blob/master/types/wx/lib.wx.api.d.ts ) 更新后及时更新。
22
+ 若基础库更新后[ lib.wx.api.d.ts] ( https://github.com/wechat-miniprogram/minigame-api-typings/blob/master/types/wx/lib.wx.api.d.ts ) 暂未更新,开发者可参考[ 自定义SDK调用] ( ./CustomSDK.md ) 临时调用WXSDK。
23
+ 以` wx.shareAppMessageToGroup ` 为例:
24
+
25
+ ``` csharp
26
+ using WeChatWASM ;
27
+
28
+ public class ShareAppMessageToGroupOption
29
+ {
30
+ public string title ;
31
+ public string path ;
32
+ public string imageUrl ;
33
+ }
34
+
35
+ // 合适位置调用
36
+ WX .CallJSFunction (" wx" , " shareAppMessageToGroup" , new ShareAppMessageToGroupOption
37
+ {
38
+ title = " 群任务" ,
39
+ });
40
+ ```
22
41
23
42
### Unity SDK 特供API
24
43
You can’t perform that action at this time.
0 commit comments