使用LoadLevel对灯光有影响 [英] Using LoadLevel has effect on light

查看:87
本文介绍了使用LoadLevel对灯光有影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Unity中制作一个简单的拼字游戏,玩家必须推开拼图才能打开通往下一个房间的门.问题是,当我进入门,并使用LoadLevel()加载下一个场景时,灯光变得比通常更暗.如果我在Unity中编辑场景并从那里开始测试,则不会发生这种情况.我想知道会发生什么,以及如何解决它.我什至制作了定向光的预制件,可以照亮场景以确保它们相等,但这没有效果.我该如何解决?

I am making a simple orthographic game in Unity, where the player has to shove a puzzle to open a door leading to the next room. The problem is, that when I enter the door, and the next scene is loaded using LoadLevel(), the light gets darker than it would normally be. This does not happen if I edit the scene inside Unity and start testing from there. I am wondering what happens, and how to fix it. I have even made a prefab of the Directional Light that lights up the scene to make sure they are equal, but that has no effect. How do I fix this?

推荐答案

这很正常.仅在编辑器中 发生,并且在启用 Continuous Baking 时也会发生.当您构建项目时,这将不存在.

This is normal. It happens in the Editor only and also when Continuous Baking is enabled. This will not be present when you build your project.

要在编辑器中解决此问题,请 Window -> Lighting -> Lightmap 标签-> 禁用连续烘焙然后单击构建"按钮以烘烤照明.

To fix this in the Editor, Window -> Lighting -> Lightmap Tab -> Disable Continuous Baking then click on the Build button to bake the lighting.

如果使用Unity 5.4,设置会稍微更改 Window -> Lighting -> Lightmap 选项卡->取消选中 自动 复选框.单击构建"按钮以烘烤照明.

If using Unity 5.4, the settings changed a little bit Window -> Lighting -> Lightmap Tab -> uncheck Auto checkbox. Click on the Build button to bake the lighting.

如果在编辑器中移动,删除或添加对象,则必须再次重新烘焙/构建光照贴图.

If you move, remove or add objects in the Editor, you must rebake/build lightmaps again.

编辑:

已将其重命名为自动生成".参见重复的新答案.对于较旧版本的Unity,此答案仍然存在.

This has been renamed to Auto-Generate. See duplicate for new answer. This answer will remain for older version of Unity.

这篇关于使用LoadLevel对灯光有影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆