1
- using System ;
2
- using System . Collections . Generic ;
3
1
using LitJson ;
4
- using UnityEngine ;
5
2
using WeChatWASM ;
6
3
7
4
public class GetInfo : Details
8
5
{
9
6
private void Start ( )
10
7
{
11
8
// 绑定额外的按钮操作
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 ) ;
21
18
}
22
19
23
20
// 测试 API
24
21
protected override void TestAPI ( string [ ] args )
25
22
{
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 ( ) ;
37
24
}
38
25
39
26
public void getSystemSetting ( )
@@ -46,68 +33,16 @@ public void getSystemSetting()
46
33
) ;
47
34
}
48
35
49
- public void getSystemInfoSync ( )
36
+ public void getAppAuthorizeSetting ( )
50
37
{
51
- var res = WX . GetSystemInfoSync ( ) ;
38
+ var res = WX . GetAppAuthorizeSetting ( ) ;
52
39
53
40
// 访问成功,显示结果
54
41
WX . ShowModal (
55
42
new ShowModalOption ( ) { content = "Access Success, Result: " + JsonMapper . ToJson ( res ) }
56
43
) ;
57
44
}
58
45
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
-
111
46
public void getDeviceInfo ( )
112
47
{
113
48
var res = WX . GetDeviceInfo ( ) ;
@@ -118,39 +53,101 @@ public void getDeviceInfo()
118
53
) ;
119
54
}
120
55
121
- public void getAppBaseInfo ( )
56
+ public void getWindowInfo ( )
122
57
{
123
- var res = WX . GetAppBaseInfo ( ) ;
58
+ var res = WX . GetWindowInfo ( ) ;
124
59
125
60
// 访问成功,显示结果
126
61
WX . ShowModal (
127
62
new ShowModalOption ( ) { content = "Access Success, Result: " + JsonMapper . ToJson ( res ) }
128
63
) ;
129
64
}
130
65
131
- public void getAppAuthorizeSetting ( )
66
+ public void getAppBaseInfo ( )
132
67
{
133
- var res = WX . GetAppAuthorizeSetting ( ) ;
68
+ var res = WX . GetAppBaseInfo ( ) ;
134
69
135
70
// 访问成功,显示结果
136
71
WX . ShowModal (
137
72
new ShowModalOption ( ) { content = "Access Success, Result: " + JsonMapper . ToJson ( res ) }
138
73
) ;
139
74
}
140
75
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 ( )
142
139
{
143
- var res = WX . GetEnterOptionsSync ( ) ;
140
+ var res = WX . GetLaunchOptionsSync ( ) ;
144
141
145
142
// 访问成功,显示结果
146
143
WX . ShowModal (
147
144
new ShowModalOption ( ) { content = "Access Success, Result: " + JsonMapper . ToJson ( res ) }
148
145
) ;
149
146
}
150
147
151
- public void getLaunchOptionsSync ( )
148
+ public void getEnterOptionsSync ( )
152
149
{
153
- var res = WX . GetLaunchOptionsSync ( ) ;
150
+ var res = WX . GetEnterOptionsSync ( ) ;
154
151
155
152
// 访问成功,显示结果
156
153
WX . ShowModal (
0 commit comments