在 Unity3D 中,点击“播放”时是否可以保持场景视图聚焦?
在 Unity3D 中,当您点击播放时,默认情况下,它会切换到完整的“游戏”视图,这非常适合预览等,但有时我们只想在“场景”视图中查看结果,因为我们不必担心设置所有的照明、材质等。
现在我们知道我们可以简单地创建一个新的布局,同时显示“游戏”和“场景”选项卡,这就是我们正在做的,这样我们就可以继续看我们开始时的“场景”选项卡。然而,我们只是根本不想看到“游戏”选项卡。喜欢将其隐藏起来,直到我们稍后需要它为止。
这可以做到吗?
In Unity3D, when you hit play, by default, it switches to the full 'Game' view which is great for previewing and such, but sometimes we just want to see our results in the 'Scene' view since we don't have to worry about setting up all the lighting, materials, etc.
Now we know we can simply create a new layout that shows both the 'Game' and the 'Scene' tabs at the same time, and that's what we're doing so we can continue to look at the 'Scene' tab when we start. However, we just don't want to see the 'Game' tab at all. Love to just hide it until we need it later.
Can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将此组件放置在任何GameObject上,并将
KeepSceneViewActive
字段设置为true
。Place this component on any GameObject and set the
KeepSceneViewActive
field totrue
.游戏运行时无法关闭游戏场景。但我找到了一个解决方法:您可以将游戏视图分离到一个单独的窗口中,使其尽可能小,并将其放置在播放按钮附近,如下所示:
现在,点击“播放”按钮后,只要游戏视图获得焦点,就单击“播放”按钮左侧的空白区域。它比用鼠标运行选项卡要快。另一方面,如果你是像我一样的键盘迷,请按 CMD+P、CMD+<;在 Mac 上或在 Windows 上的同等版本上。
The game scene can't be closed while running the game. But I found a little workaround: You can detach the Game view into a separate window make it as small as possible and position it near the play button like this:
Now after you hit the play button just click into the empty area left from the play button as soon as the game view gets the focus. It's faster than running with your mouse to the tabs. On the other side if you are a keyboard junkie like me hit CMD+P, CMD+< on Mac or the equivalent on Windows.