简体   繁体   English

Unity3d脚本似乎在一个场景中起作用,但在另一个场景中不起作用

[英]Unity3d script seems to work in one scene but not another

I am working on a group of scenes for an opening menu (Start, Options, Exit, etc). 我正在为打开菜单(开始,选项,退出等)处理一组场景。

Right now, I have the exact same "Back" 3d Text GameObject in two of my scenes that have the same script that when clicked, uses Application.LoadLevel("Main") to return to the Main scene. 现在,我在两个场景中具有完全相同的“后退” 3d文字游戏对象,它们具有与单击时使用Application.LoadLevel(“ Main”)返回主场景相同的脚本。

The problem is, "Back" only works in one of the scenes. 问题是,“后退”仅在其中一个场景中有效。 It does not seem to be working in the other. 它似乎在另一个方面不起作用。 They are identical (Script attached, position, name, etc.). 它们是相同的(附加的脚本,位置,名称等)。

Any ideas what might be causing this or why this is happening? 任何想法可能是什么原因或为什么会这样?

Thanks in advance! 提前致谢!

Fixed the problem by copying over all of the assets in the problem scene to a new scene. 通过将问题场景中的所有资产复制到新场景来解决问题。 Now it works like a charm. 现在,它就像一种魅力。

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

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