Skip to content

Commit 1628991

Browse files
committed
脚本修改及重命名
1 parent 216ea52 commit 1628991

File tree

5 files changed

+67
-24
lines changed

5 files changed

+67
-24
lines changed

Demo/API_V2/Assets/API/Render/ToTempFilePath.meta

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

Demo/API_V2/Assets/API/Render/ToTempFilePath/ToTempFilePath.cs

+25-21
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,44 @@ protected override void TestAPI(string[] args)
1212

1313
private void LoadCanvasToTempFilePath()
1414
{
15-
var sys = WX.GetSystemInfoSync();
16-
Debug.Log("screenWidth:" + sys.screenWidth);
17-
Debug.Log("screenHeight:" + sys.screenHeight);
18-
Debug.Log("windowWidth:" + sys.windowWidth);
19-
Debug.Log("windowHeight:" + sys.windowHeight);
15+
var sys = WX.GetSystemInfoSync();
16+
string sysInfo = string.Format(
17+
"屏幕信息:\nscreenWidth:{0}\nscreenHeight:{1}\nwindowWidth:{2}\nwindowHeight:{3}\n",
18+
sys.screenWidth, sys.screenHeight, sys.windowWidth, sys.windowHeight
19+
);
2020

21-
Debug.Log("UnityEngine.Screen.width;" + UnityEngine.Screen.width);
22-
Debug.Log("UnityEngine.Screen.height;" + UnityEngine.Screen.height);
23-
24-
int ShareHeight = UnityEngine.Screen.height / 3;
21+
2522
WXCanvas.ToTempFilePath(new WXToTempFilePathParam()
2623
{
27-
x = (UnityEngine.Screen.width - ShareHeight) / 2,
28-
y = ShareHeight,
29-
width = ShareHeight,
30-
height = ShareHeight,
31-
destWidth = ShareHeight,
32-
destHeight = ShareHeight,
3324
success = (result) =>
3425
{
35-
Debug.Log("ToTempFilePath success" + JsonUtility.ToJson(result));
36-
WX.ShareAppMessage(new ShareAppMessageOption()
26+
WX.ShowModal(new ShowModalOption()
3727
{
38-
title = "这是你的标题",
39-
imageUrl = result.tempFilePath,
28+
title = "截图成功",
29+
content = "临时文件路径:" + result.tempFilePath + "\n\n" + sysInfo,
30+
showCancel = false,
31+
success = (res) =>
32+
{
33+
WX.ShareAppMessage(new ShareAppMessageOption()
34+
{
35+
title = "这是你的标题",
36+
imageUrl = result.tempFilePath,
37+
});
38+
}
4039
});
4140
},
4241
fail = (result) =>
4342
{
44-
Debug.Log("ToTempFilePath fail" + JsonUtility.ToJson(result));
43+
WX.ShowModal(new ShowModalOption()
44+
{
45+
title = "截图失败",
46+
content = JsonUtility.ToJson(result),
47+
showCancel = false
48+
});
4549
},
4650
complete = (result) =>
4751
{
48-
Debug.Log("ToTempFilePath complete" + JsonUtility.ToJson(result));
52+
//完成处理
4953
},
5054
});
5155
}

Demo/API_V2/Assets/API/Render/ToTempFilePath/ToTempFilePath.cs.meta

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

Demo/API_V2/Assets/API/Render/ToTempFilePath/ToTempFilePath.asset renamed to Demo/API_V2/Assets/API/Render/ToTempFilePath/ToTempFilePathSO.asset

+15-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,25 @@ MonoBehaviour:
1010
m_Enabled: 1
1111
m_EditorHideFlags: 0
1212
m_Script: {fileID: 11500000, guid: fb48e4613a53bb941a20036d7c08fefb, type: 3}
13-
m_Name: ToTempFilePath
13+
m_Name: ToTempFilePathSO
1414
m_EditorClassIdentifier:
1515
entryScriptTypeName: ToTempFilePath
1616
entryName: ToTempFilePath
1717
entryAPI: Canvas.toTempFilePath
18-
entryDescription: Canvas.toTempFilePath
19-
optionList: []
18+
entryDescription: "\u5C06\u5F53\u524D Canvas \u4FDD\u5B58\u4E3A\u4E00\u4E2A\u4E34\u65F6\u6587\u4EF6\u3002"
19+
optionList:
20+
- optionName: x
21+
availableOptions:
22+
- "\u9ED8\u8BA4\u503C0"
23+
- optionName: y
24+
availableOptions:
25+
- "\u9ED8\u8BA4\u503C0"
26+
- optionName: width
27+
availableOptions:
28+
- "\u9ED8\u8BA4\u503Ccanvas \u7684\u5BBD\u5EA6"
29+
- optionName: height
30+
availableOptions:
31+
- "\u9ED8\u8BA4\u503Ccanvas \u7684\u9AD8\u5EA6"
2032
initialButtonText: "\u8FD0\u884C\u622A\u56FE"
2133
extraButtonList: []
2234
initialResultList: []

Demo/API_V2/Assets/API/Render/ToTempFilePath/ToTempFilePathSO.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)