Skip to content

Commit cf47165

Browse files
author
uhu
committed
feat: update md
1 parent feab39d commit cf47165

File tree

4 files changed

+37
-33
lines changed

4 files changed

+37
-33
lines changed

Demo/API/Assets/Scripts/Inputs.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
public class Inputs : MonoBehaviour, IPointerClickHandler, IPointerExitHandler
88
{
99
public InputField input;
10-
private bool isShowKeyboad = false;
10+
private bool isShowKeyboard = false;
1111
public void OnPointerClick(PointerEventData eventData)
1212
{
13-
Debug.Log("ooooo");
14-
ShowKeyboad();
13+
Debug.Log("OnPointerClick");
14+
ShowKeyboard();
1515
}
1616

1717
public void OnPointerExit(PointerEventData eventData)
1818
{
19-
// 隐藏输入法
19+
Debug.Log("OnPointerExit");
2020
if (!input.isFocused)
2121
{
22-
HideKeyboad();
22+
HideKeyboard();
2323
}
2424
}
2525

@@ -38,20 +38,20 @@ public void OnConfirm(OnKeyboardInputListenerResult v)
3838
// 输入法confirm回调
3939
Debug.Log("onConfirm");
4040
Debug.Log(v.value);
41-
HideKeyboad();
41+
HideKeyboard();
4242
}
4343

4444
public void OnComplete(OnKeyboardInputListenerResult v)
4545
{
4646
// 输入法complete回调
4747
Debug.Log("OnComplete");
4848
Debug.Log(v.value);
49-
HideKeyboad();
49+
HideKeyboard();
5050
}
5151

52-
private void ShowKeyboad()
52+
private void ShowKeyboard()
5353
{
54-
if (!isShowKeyboad)
54+
if (!isShowKeyboard)
5555
{
5656
WX.ShowKeyboard(new ShowKeyboardOption()
5757
{
@@ -64,20 +64,20 @@ private void ShowKeyboad()
6464
WX.OnKeyboardConfirm(OnConfirm);
6565
WX.OnKeyboardComplete(OnComplete);
6666
WX.OnKeyboardInput(OnInput);
67-
isShowKeyboad = true;
67+
isShowKeyboard = true;
6868
}
6969
}
7070

71-
private void HideKeyboad()
71+
private void HideKeyboard()
7272
{
73-
if (isShowKeyboad)
73+
if (isShowKeyboard)
7474
{
7575
WX.HideKeyboard(new HideKeyboardOption());
7676
//删除掉相关事件监听
7777
WX.OffKeyboardInput(OnInput);
7878
WX.OffKeyboardConfirm(OnConfirm);
7979
WX.OffKeyboardComplete(OnComplete);
80-
isShowKeyboad = false;
80+
isShowKeyboard = false;
8181
}
8282
}
8383
}

Demo/API/Assets/Scripts/VideoDecoderManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ private void Start()
2323

2424
private void CreateVideoDecoder()
2525
{
26+
// 8.0.38客户端+3.0.0基础库,才能正常使用
2627
wxVideoDecoder = WX.CreateVideoDecoder();
2728

2829
wxVideoDecoder.On("start", (res) =>

Design/DevelopmentQAList.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ if (WXConvertCore.DoExport() == WXConvertCore.WXExportError.SUCCEED) {
156156
- 转换方案已通过WebAudio支持Unity音频,通常无需替换
157157
#### 8.PlayerPref或用户数据存储失效
158158

159-
- 使用小程序云开发或自建服务器进行云端存储(推荐,因本地存储的话,由于微信环境下玩家非常容易删除本地小游戏而导致存档丢失)
159+
- 使用小程序云开发或自建服务器进行云端存储推荐,因本地存储的话,由于微信环境下玩家非常容易删除本地小游戏而导致存档丢失)
160160
- 使用WX C# SDK提供的PlayerPref进行存储,可以替代已有Unity的PlayerPref。但需要注意该部分数据使用小游戏Storage,有10MB存储上限。 由于接口是同步调用(阻塞游戏线程),不建议频率过高的调用。“存储“请参考https://developers.weixin.qq.com/minigame/dev/guide/base-ability/storage.html
161161
- 使用WX C# SDK的文件API进行自行本地存储,他会与游戏资源缓存共用“文件系统”区域,有200MB存储上限,建议使用异步接口以不影响主线程帧率。“文件系统”请参考https://developers.weixin.qq.com/minigame/dev/guide/base-ability/file-system.html
162162
- 总体而言,尽量使用云端存储。对于少量数据可以采用后两种方式,缺点是用户删除本地小游戏则记录丢失,同时要注意避免频繁的同步接口调用。

Design/InputAdaptation.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,56 +6,60 @@
66

77
以UGUI的Input组件为例,需要给Input 绑定以下脚本:
88
```
9+
using UnityEngine;
10+
using System.Collections;
11+
using WeChatWASM;
12+
using UnityEngine.UI;
13+
using UnityEngine.EventSystems;
14+
915
public class Inputs : MonoBehaviour, IPointerClickHandler, IPointerExitHandler
1016
{
1117
public InputField input;
12-
private bool isShowKeyboad = false;
18+
private bool isShowKeyboard = false;
1319
public void OnPointerClick(PointerEventData eventData)
1420
{
15-
Debug.Log("ooooo");
16-
ShowKeyboad();
21+
Debug.Log("OnPointerClick");
22+
ShowKeyboard();
1723
}
1824
1925
public void OnPointerExit(PointerEventData eventData)
2026
{
21-
// 隐藏输入法
27+
Debug.Log("OnPointerExit");
2228
if (!input.isFocused)
2329
{
24-
HideKeyboad();
30+
HideKeyboard();
2531
}
26-
2732
}
2833
29-
public void OnInput(OnKeyboardInputCallbackResult v)
34+
public void OnInput(OnKeyboardInputListenerResult v)
3035
{
3136
Debug.Log("onInput");
3237
Debug.Log(v.value);
3338
if (input.isFocused)
3439
{
3540
input.text = v.value;
3641
}
37-
3842
}
3943
40-
public void OnConfirm(OnKeyboardInputCallbackResult v)
44+
public void OnConfirm(OnKeyboardInputListenerResult v)
4145
{
4246
// 输入法confirm回调
4347
Debug.Log("onConfirm");
4448
Debug.Log(v.value);
45-
HideKeyboad();
49+
HideKeyboard();
4650
}
4751
48-
public void OnComplete(OnKeyboardInputCallbackResult v)
52+
public void OnComplete(OnKeyboardInputListenerResult v)
4953
{
5054
// 输入法complete回调
5155
Debug.Log("OnComplete");
5256
Debug.Log(v.value);
53-
HideKeyboad();
57+
HideKeyboard();
5458
}
5559
56-
private void ShowKeyboad()
60+
private void ShowKeyboard()
5761
{
58-
if (!isShowKeyboad)
62+
if (!isShowKeyboard)
5963
{
6064
WX.ShowKeyboard(new ShowKeyboardOption()
6165
{
@@ -68,22 +72,21 @@ public class Inputs : MonoBehaviour, IPointerClickHandler, IPointerExitHandler
6872
WX.OnKeyboardConfirm(OnConfirm);
6973
WX.OnKeyboardComplete(OnComplete);
7074
WX.OnKeyboardInput(OnInput);
71-
isShowKeyboad = true;
75+
isShowKeyboard = true;
7276
}
7377
}
7478
75-
private void HideKeyboad()
79+
private void HideKeyboard()
7680
{
77-
if (isShowKeyboad)
81+
if (isShowKeyboard)
7882
{
7983
WX.HideKeyboard(new HideKeyboardOption());
8084
//删除掉相关事件监听
8185
WX.OffKeyboardInput(OnInput);
8286
WX.OffKeyboardConfirm(OnConfirm);
8387
WX.OffKeyboardComplete(OnComplete);
84-
isShowKeyboad = false;
88+
isShowKeyboard = false;
8589
}
8690
}
87-
8891
}
8992
```

0 commit comments

Comments
 (0)