Skip to content

Commit

Permalink
脚本修改及重命名
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentWSZ committed Dec 26, 2024
1 parent 216ea52 commit 1628991
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 24 deletions.
8 changes: 8 additions & 0 deletions Demo/API_V2/Assets/API/Render/ToTempFilePath.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 25 additions & 21 deletions Demo/API_V2/Assets/API/Render/ToTempFilePath/ToTempFilePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,44 @@ protected override void TestAPI(string[] args)

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

Debug.Log("UnityEngine.Screen.width;" + UnityEngine.Screen.width);
Debug.Log("UnityEngine.Screen.height;" + UnityEngine.Screen.height);

int ShareHeight = UnityEngine.Screen.height / 3;

WXCanvas.ToTempFilePath(new WXToTempFilePathParam()
{
x = (UnityEngine.Screen.width - ShareHeight) / 2,
y = ShareHeight,
width = ShareHeight,
height = ShareHeight,
destWidth = ShareHeight,
destHeight = ShareHeight,
success = (result) =>
{
Debug.Log("ToTempFilePath success" + JsonUtility.ToJson(result));
WX.ShareAppMessage(new ShareAppMessageOption()
WX.ShowModal(new ShowModalOption()
{
title = "这是你的标题",
imageUrl = result.tempFilePath,
title = "截图成功",
content = "临时文件路径:" + result.tempFilePath + "\n\n" + sysInfo,
showCancel = false,
success = (res) =>
{
WX.ShareAppMessage(new ShareAppMessageOption()
{
title = "这是你的标题",
imageUrl = result.tempFilePath,
});
}
});
},
fail = (result) =>
{
Debug.Log("ToTempFilePath fail" + JsonUtility.ToJson(result));
WX.ShowModal(new ShowModalOption()
{
title = "截图失败",
content = JsonUtility.ToJson(result),
showCancel = false
});
},
complete = (result) =>
{
Debug.Log("ToTempFilePath complete" + JsonUtility.ToJson(result));
//完成处理
},
});
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,25 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fb48e4613a53bb941a20036d7c08fefb, type: 3}
m_Name: ToTempFilePath
m_Name: ToTempFilePathSO
m_EditorClassIdentifier:
entryScriptTypeName: ToTempFilePath
entryName: ToTempFilePath
entryAPI: Canvas.toTempFilePath
entryDescription: Canvas.toTempFilePath
optionList: []
entryDescription: "\u5C06\u5F53\u524D Canvas \u4FDD\u5B58\u4E3A\u4E00\u4E2A\u4E34\u65F6\u6587\u4EF6\u3002"
optionList:
- optionName: x
availableOptions:
- "\u9ED8\u8BA4\u503C0"
- optionName: y
availableOptions:
- "\u9ED8\u8BA4\u503C0"
- optionName: width
availableOptions:
- "\u9ED8\u8BA4\u503Ccanvas \u7684\u5BBD\u5EA6"
- optionName: height
availableOptions:
- "\u9ED8\u8BA4\u503Ccanvas \u7684\u9AD8\u5EA6"
initialButtonText: "\u8FD0\u884C\u622A\u56FE"
extraButtonList: []
initialResultList: []
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1628991

Please sign in to comment.