unity 加载场景时加载失败的问题

需要实现场景跳转的功能,而且需要实现跳转的场景不是一个,其中一个可以很好的跳转,但是另一个新建的场景在跳转时却报错

Scene 'BatteryMaintenance' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.


场景“电池维护”不能被加载,因为它没有被添加到构建设置或资产包没有被加载。

要添加一个场景到构建设置使用菜单文件->构建设置…

这是因为在BuildSetting中没有将此场景添加进去。

unity 加载场景时加载失败的问题

在Build Steings中将场景添加进去就可。