【发布时间】:2017-08-26 01:23:25
【问题描述】:
我正在尝试创建一些屏幕截图,但 ScreenCapture.CaptureScreenshot 实际上捕获了整个编辑器,而不仅仅是游戏视图。
public class ScreenShotTaker : MonoBehaviour
{
public KeyCode takeScreenshotKey = KeyCode.S;
public int screenshotCount = 0;
private void Update()
{
if (Input.GetKeyDown(takeScreenshotKey))
{
ScreenCapture.CaptureScreenshot("Screenshots/"
+ "_" + screenshotCount + "_"+ Screen.width + "X" + Screen.height + "" + ".png");
Debug.Log("Screenshot taken.");
}
}
}
可能是什么问题?如何拍摄一个像样的、仅包含 UI 的游戏视图屏幕截图?
注意,UI的东西,我在网上找到了其他方法来截图(使用RenderTextures),但那些不包括UI。在我的另一个“真实”项目中,我也有 UI,我刚刚打开了这个测试项目,看看屏幕截图问题是否仍然存在。
【问题讨论】:
-
用户界面有什么用?
-
其他一些使用
RenderTextures的方法不起作用,因为它们不包含用户界面。
标签: c# unity3d screenshot