直接本上代码。
IEnumerator GetScreenshot()
{
// 截屏1帧后再呼起微信
yield return new WaitForEndOfFrame();
string imgPath = System.IO.Path.Combine(Application.persistentDataPath, "Screenshot.jpg");
int width = Screen.width;
int height = Screen.height;
Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false);
tex.ReadPixels(new Rect(0, 0, width, height), 0, 0,

本文介绍如何在Unity中获取屏幕截图,并详细说明如何在Android和iOS平台上呼起微信进行分享,参考官方文档完成跨平台实现。
521

被折叠的 条评论
为什么被折叠?



