简体   繁体   English

Unity 构建游戏的游戏视图与编辑器中的不同

[英]Unity build game has a different game view than in editor

I've been following after a course to learn Unity.我一直在学习Unity的课程。 Everything is working inside the editor, but when building the game, the game area that player sees is different than what is set in Unity editor.一切都在编辑器中进行,但是在构建游戏时,玩家看到的游戏区域与 Unity 编辑器中设置的不同。

在此处输入图片说明

The aspect ratio is set to 9:16 and I've tried to set the default screen resolution to those aspects, like 1080 for width and 1920 for height.纵横比设置为 9:16,我尝试将默认屏幕分辨率设置为这些方面,例如宽度为 1080,高度为 1920。 But as you can see, the red line is what should be the edge of the screen (in unity editor, that is indeed the edge of the screen) but in build game it is not.但是正如你所看到的,红线应该是屏幕的边缘(在统一编辑器中,这确实是屏幕的边缘)但在构建游戏中它不是。 Player is not supposed to see any of the black background.玩家不应该看到任何黑色背景。

Any ideas?有任何想法吗?

It's an easy fix - just go to the game view, and in the top left there your aspect ratio, For now it's probably "Free Aspect", just press on the down arrow to the right of it and press that little plus button and add your own aspect ratio!这是一个简单的修复 - 只需转到游戏视图,在左上角有你的纵横比,现在它可能是“自由纵横比”,只需按下它右侧的向下箭头,然后按下那个小加号按钮并添加你自己的纵横比!

Good luck with your game!祝你游戏好运!

enter image description here在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM