简体   繁体   English

为什么当我按“播放”时游戏场景为空?

[英]Why is the game scene empty when I press “play”?

I'm trying to open up a game demo from my class to see what it looks like, but after opening up the project in Unity, going to the "Game" tab on the upper part of the screen, and pressing "play", nothing shows up. 我试图从班级中打开一个游戏演示,以查看其外观,但是在Unity中打开项目后,转到屏幕上方的“游戏”标签,然后按“播放”,没有任何显示。 I'm new to Unity so I have no idea why the screen is blank (there should be a title screen that says "Traffic Jam" and a play button). 我是Unity新手,所以我不知道为什么屏幕空白(应该有一个标题屏幕,显示“ Traffic Jam”和一个播放按钮)。 I'll attach a screenshot of my workspace below. 我将在下面附上我的工作区的屏幕截图。 Thank you in advance! 先感谢您!

Note: I read somewhere about changing the "Layout" dropdown option in the upper right corner to "Default", but even if I do that, the title screen doesn't show up correctly. 注意:我读过一些有关将右上角的“布局”下拉选项更改为“默认”的信息,但是即使这样做,标题屏幕也无法正确显示。

在此处输入图片说明

Here is a link to the project if you want to try it out yourself: https://drive.google.com/file/d/1ekXt948b612dmyT1AZReUOuzh2XbnSDG/view?usp=sharing 如果您想自己尝试一下,这里是项目的链接: https : //drive.google.com/file/d/1ekXt948b612dmyT1AZReUOuzh2XbnSDG/view?usp=sharing

UPDATE: I've now opened the scene and have all the objects displayed, however some things still don't seem to be quite right. 更新:我现在打开了场景并显示了所有对象,但是有些事情似乎还不太正确。 The title of the game is not shown when it should be and although the "play" button is shown, clicking on it doesn't get the game started as it should. 游戏标题不应该显示,尽管显示了“播放”按钮,但是单击它并不能像应该那样启动游戏。 在此处输入图片说明

You should open the scene you are highlighting, by double clicking. 您应该通过双击打开要突出显示的场景。 You can also open the unity project by double clicking the scene directly from windows explorer. 您也可以通过直接从Windows资源管理器中双击场景来打开unity项目。

文件管理器

When unity has opened that scene, this is what you will see. 当团结打开了那个场景时,这就是您所看到的。

场景视图

And this will then be your game view: 这就是您的游戏视图:

游戏视角

This is what happens when I click play and die. 这是当我单击“播放并死亡”时发生的情况。 屏幕游戏

After opening a Unity project, ensure you are also opening the correct Unity Scene. 打开Unity项目后,请确保您还打开了正确的Unity场景。 Most Unity project usually contains multiple Scene files which will have different contents. 大多数Unity项目通常包含多个场景文件,这些文件将具有不同的内容。

I can see in your Project tab that you have a Unity scene file which is not currently open, if you double click this it should take you to your scene. 我可以在“项目”选项卡中看到您有一个当前尚未打开的Unity场景文件,如果您双击该文件,它将带您进入场景。

Unity场景文件

I can tell that this is not open as the Hierarchy would show the name of the currently open scene instead of 'Untitled'. 我可以说这没有打开,因为层次结构将显示当前打开的场景的名称,而不是“无标题”。

在此处输入图片说明

If this file does not contain the items you are looking for you should check other folder in your project for Unity scene files (did you save it as something else?) 如果此文件不包含您要查找的项目,则应检查项目中其他文件夹中的Unity场景文件(是否将其另存为其他文件?)

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

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