Skip to content

Commit acd1cd8

Browse files
committed
fix: 优化布局与目录结构
1 parent 4fb6880 commit acd1cd8

File tree

14 files changed

+108
-170
lines changed

14 files changed

+108
-170
lines changed

Demo/API_V2/Assets/API/Base/Get/GetInfo.cs renamed to Demo/API_V2/Assets/API/Base/GetInfo/GetInfo.cs

Lines changed: 82 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
1-
using System;
2-
using System.Collections.Generic;
31
using LitJson;
4-
using UnityEngine;
52
using WeChatWASM;
63

74
public class GetInfo : Details
85
{
96
private void Start()
107
{
118
// 绑定额外的按钮操作
12-
GameManager.Instance.detailsController.BindExtraButtonAction(0, getSystemSetting);
13-
GameManager.Instance.detailsController.BindExtraButtonAction(1, getSystemInfoSync);
14-
GameManager.Instance.detailsController.BindExtraButtonAction(2, getSystemInfoAsync);
15-
GameManager.Instance.detailsController.BindExtraButtonAction(3, getSystemInfo);
16-
GameManager.Instance.detailsController.BindExtraButtonAction(4, getDeviceInfo);
17-
GameManager.Instance.detailsController.BindExtraButtonAction(5, getAppBaseInfo);
18-
GameManager.Instance.detailsController.BindExtraButtonAction(6, getAppAuthorizeSetting);
19-
GameManager.Instance.detailsController.BindExtraButtonAction(7, getLaunchOptionsSync);
20-
GameManager.Instance.detailsController.BindExtraButtonAction(8, getEnterOptionsSync);
9+
GameManager.Instance.detailsController.BindExtraButtonAction(0, getAppAuthorizeSetting);
10+
GameManager.Instance.detailsController.BindExtraButtonAction(1, getDeviceInfo);
11+
GameManager.Instance.detailsController.BindExtraButtonAction(2, getWindowInfo);
12+
GameManager.Instance.detailsController.BindExtraButtonAction(3, getAppBaseInfo);
13+
// GameManager.Instance.detailsController.BindExtraButtonAction(1, getSystemInfoSync);
14+
// GameManager.Instance.detailsController.BindExtraButtonAction(2, getSystemInfoAsync);
15+
// GameManager.Instance.detailsController.BindExtraButtonAction(3, getSystemInfo);
16+
GameManager.Instance.detailsController.BindExtraButtonAction(4, getLaunchOptionsSync);
17+
GameManager.Instance.detailsController.BindExtraButtonAction(5, getEnterOptionsSync);
2118
}
2219

2320
// 测试 API
2421
protected override void TestAPI(string[] args)
2522
{
26-
getWindowInfo();
27-
}
28-
29-
public void getWindowInfo()
30-
{
31-
var res = WX.GetWindowInfo();
32-
33-
// 访问成功,显示结果
34-
WX.ShowModal(
35-
new ShowModalOption() { content = "Access Success, Result: " + JsonMapper.ToJson(res) }
36-
);
23+
getSystemSetting();
3724
}
3825

3926
public void getSystemSetting()
@@ -46,68 +33,16 @@ public void getSystemSetting()
4633
);
4734
}
4835

49-
public void getSystemInfoSync()
36+
public void getAppAuthorizeSetting()
5037
{
51-
var res = WX.GetSystemInfoSync();
38+
var res = WX.GetAppAuthorizeSetting();
5239

5340
// 访问成功,显示结果
5441
WX.ShowModal(
5542
new ShowModalOption() { content = "Access Success, Result: " + JsonMapper.ToJson(res) }
5643
);
5744
}
5845

59-
public void getSystemInfoAsync()
60-
{
61-
WX.GetSystemInfoAsync(
62-
new GetSystemInfoAsyncOption
63-
{
64-
success = (res) =>
65-
{
66-
WX.ShowModal(
67-
new ShowModalOption()
68-
{
69-
content = "Access Success, Result: " + JsonMapper.ToJson(res)
70-
}
71-
);
72-
},
73-
fail = (res) =>
74-
{
75-
Debug.Log("fail:" + res.errMsg);
76-
},
77-
complete = (res) =>
78-
{
79-
Debug.Log("complete!");
80-
}
81-
}
82-
);
83-
}
84-
85-
public void getSystemInfo()
86-
{
87-
WX.GetSystemInfo(
88-
new GetSystemInfoOption
89-
{
90-
success = (res) =>
91-
{
92-
WX.ShowModal(
93-
new ShowModalOption()
94-
{
95-
content = "Access Success, Result: " + JsonMapper.ToJson(res)
96-
}
97-
);
98-
},
99-
fail = (res) =>
100-
{
101-
Debug.Log("fail:" + res.errMsg);
102-
},
103-
complete = (res) =>
104-
{
105-
Debug.Log("complete!");
106-
}
107-
}
108-
);
109-
}
110-
11146
public void getDeviceInfo()
11247
{
11348
var res = WX.GetDeviceInfo();
@@ -118,39 +53,101 @@ public void getDeviceInfo()
11853
);
11954
}
12055

121-
public void getAppBaseInfo()
56+
public void getWindowInfo()
12257
{
123-
var res = WX.GetAppBaseInfo();
58+
var res = WX.GetWindowInfo();
12459

12560
// 访问成功,显示结果
12661
WX.ShowModal(
12762
new ShowModalOption() { content = "Access Success, Result: " + JsonMapper.ToJson(res) }
12863
);
12964
}
13065

131-
public void getAppAuthorizeSetting()
66+
public void getAppBaseInfo()
13267
{
133-
var res = WX.GetAppAuthorizeSetting();
68+
var res = WX.GetAppBaseInfo();
13469

13570
// 访问成功,显示结果
13671
WX.ShowModal(
13772
new ShowModalOption() { content = "Access Success, Result: " + JsonMapper.ToJson(res) }
13873
);
13974
}
14075

141-
public void getEnterOptionsSync()
76+
// public void getSystemInfoSync()
77+
// {
78+
// var res = WX.GetSystemInfoSync();
79+
//
80+
// // 访问成功,显示结果
81+
// WX.ShowModal(
82+
// new ShowModalOption() { content = "Access Success, Result: " + JsonMapper.ToJson(res) }
83+
// );
84+
// }
85+
//
86+
// public void getSystemInfoAsync()
87+
// {
88+
// WX.GetSystemInfoAsync(
89+
// new GetSystemInfoAsyncOption
90+
// {
91+
// success = (res) =>
92+
// {
93+
// WX.ShowModal(
94+
// new ShowModalOption()
95+
// {
96+
// content = "Access Success, Result: " + JsonMapper.ToJson(res)
97+
// }
98+
// );
99+
// },
100+
// fail = (res) =>
101+
// {
102+
// Debug.Log("fail:" + res.errMsg);
103+
// },
104+
// complete = (res) =>
105+
// {
106+
// Debug.Log("complete!");
107+
// }
108+
// }
109+
// );
110+
// }
111+
//
112+
// public void getSystemInfo()
113+
// {
114+
// WX.GetSystemInfo(
115+
// new GetSystemInfoOption
116+
// {
117+
// success = (res) =>
118+
// {
119+
// WX.ShowModal(
120+
// new ShowModalOption()
121+
// {
122+
// content = "Access Success, Result: " + JsonMapper.ToJson(res)
123+
// }
124+
// );
125+
// },
126+
// fail = (res) =>
127+
// {
128+
// Debug.Log("fail:" + res.errMsg);
129+
// },
130+
// complete = (res) =>
131+
// {
132+
// Debug.Log("complete!");
133+
// }
134+
// }
135+
// );
136+
// }
137+
138+
public void getLaunchOptionsSync()
142139
{
143-
var res = WX.GetEnterOptionsSync();
140+
var res = WX.GetLaunchOptionsSync();
144141

145142
// 访问成功,显示结果
146143
WX.ShowModal(
147144
new ShowModalOption() { content = "Access Success, Result: " + JsonMapper.ToJson(res) }
148145
);
149146
}
150147

151-
public void getLaunchOptionsSync()
148+
public void getEnterOptionsSync()
152149
{
153-
var res = WX.GetLaunchOptionsSync();
150+
var res = WX.GetEnterOptionsSync();
154151

155152
// 访问成功,显示结果
156153
WX.ShowModal(

Demo/API_V2/Assets/API/Base/Get/GetInfoSO.asset renamed to Demo/API_V2/Assets/API/Base/GetInfo/GetInfoSO.asset

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,16 @@ MonoBehaviour:
1414
m_EditorClassIdentifier:
1515
entryScriptTypeName: GetInfo
1616
entryName: "\u83B7\u53D6\u7CFB\u7EDF\u548C\u8BBE\u5907\u4FE1\u606F"
17-
entryAPI: "getWindowInfo\uFF5CgetSystemSetting\ngetSystemInfoSync \uFF5CgetSystemInfoAsync\ngetSystemInfo
18-
\uFF5CgetDeviceInfo\ngetAppBaseInfo \uFF5CgetAppAuthorizeSetting\ngetEnterOptionsSync
19-
\uFF5C getLaunchOptionsSync"
20-
entryDescription:
17+
entryAPI: "getSystemSetting\uFF5CgetAppAuthorizeSetting\ngetDeviceInfo\uFF5CgetWindowInfo\ngetAppBaseInfo\ngetEnterOptionsSync\uFF5CgetLaunchOptionsSync"
18+
entryDescription: "<color=red>\u4ECE\u57FA\u7840\u5E93 2.20.1 \u5F00\u59CB\uFF0Cwx.getSystemInfo(Sync/Async)\u505C\u6B62\u7EF4\u62A4
19+
</color>"
2120
optionList: []
22-
initialButtonText: "\u83B7\u53D6\u7A97\u53E3\u4FE1\u606F"
21+
initialButtonText: "\u83B7\u53D6\u8BBE\u5907\u8BBE\u7F6E"
2322
extraButtonList:
24-
- buttonText: "\u83B7\u53D6\u8BBE\u5907\u8BBE\u7F6E "
25-
- buttonText: "\u83B7\u53D6\u7CFB\u7EDF\u4FE1\u606F-\u540C\u6B65"
26-
- buttonText: "\u83B7\u53D6\u7CFB\u7EDF\u4FE1\u606F-\u5F02\u6B65"
27-
- buttonText: "\u83B7\u53D6\u7CFB\u7EDF\u4FE1\u606F"
23+
- buttonText: "\u83B7\u53D6\u5FAE\u4FE1APP\u6388\u6743\u8BBE\u7F6E"
2824
- buttonText: "\u83B7\u53D6\u8BBE\u5907\u57FA\u7840\u4FE1\u606F"
25+
- buttonText: "\u83B7\u53D6\u7A97\u53E3\u4FE1\u606F"
2926
- buttonText: "\u83B7\u53D6\u5FAE\u4FE1APP\u57FA\u7840\u4FE1\u606F"
30-
- buttonText: "\u83B7\u53D6\u5FAE\u4FE1APP\u6388\u6743\u8BBE\u7F6E"
3127
- buttonText: "\u83B7\u53D6\u5C0F\u6E38\u620F\u51B7\u542F\u52A8\u65F6\u7684\u53C2\u6570"
3228
- buttonText: "\u83B7\u53D6\u5C0F\u6E38\u620F\u6253\u5F00\u7684\u53C2\u6570"
3329
initialResultList: []

Demo/API_V2/Assets/API/Network/UDPSocket/UDPSocket.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ private void write()
9595
option.message = _bufferData;
9696
}
9797
_udpSocket.Write(option);
98+
Debug.Log("Message: " + option.message);
9899
}
99100
else
100101
{

0 commit comments

Comments
 (0)