Application.LoadLevel & Object.DontDestroyOnLoad
2014-06-24 11:30
369 查看
【Application.LoadLevel】
只有在File->Build Setting中设置了的按钮才能被加载。
当level加载完成后,MonoBehaviour.OnLevelWasLoaded is called on all active game objects。
When loading a new level all game objects that have been loaded before are destroyed. If you want to let an object survive when loading a new level, use Object.DontDestroyOnLoad.
Calling LoadLevel will update Application.loadedLevel and Application.loadedLevelName.
参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/Application.LoadLevel.html
【Object.DontDestroyOnLoad】
When loading a new level all objects in the scene are destroyed, then the objects in the new level are loaded. In order to preserve an object during level loading call DontDestroyOnLoad on it. If the object is a component or game object then its entire transform hierarchy will not be destroyed either.
参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/Object.DontDestroyOnLoad.html
只有在File->Build Setting中设置了的按钮才能被加载。
当level加载完成后,MonoBehaviour.OnLevelWasLoaded is called on all active game objects。
When loading a new level all game objects that have been loaded before are destroyed. If you want to let an object survive when loading a new level, use Object.DontDestroyOnLoad.
Calling LoadLevel will update Application.loadedLevel and Application.loadedLevelName.
参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/Application.LoadLevel.html
【Object.DontDestroyOnLoad】
When loading a new level all objects in the scene are destroyed, then the objects in the new level are loaded. In order to preserve an object during level loading call DontDestroyOnLoad on it. If the object is a component or game object then its entire transform hierarchy will not be destroyed either.
参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/Object.DontDestroyOnLoad.html
相关文章推荐
- Object.DontDestroyOnLoad
- 10g & 11g Configuration of TAF(Transparent Application Failover) and Load Balancing [ID 453293.1]
- 10g & 11g Configuration of TAF(Transparent Application Failover) and Load Balancing
- DontDestroyOnLoad(Unity3D开发之五)
- DontDestroyOnLoad(Unity3D开发之五)
- web.py 直接使用示例代码,web.application报错, 'module' object has no attribute 'application',问题原因分析
- Tomcat异常:Illegal access: this web application instance has been stopped already. Could not load java.lang.Object.
- This application failed to start because it could not find or load the Qt platform plugin "xcb".
- 【原创】Object.Destroy 销毁
- This application failed to start because it could not find or load the Qt platform plugin "xcb".
- Unable to cast COM object of type Microsoft.Office.Interop.Excel.ApplicationClass' ...
- Unable to cast COM object of type 'Word.ApplicationClass' to interface type 'Word._Application'"
- load(url)与loadXML(xml/string)【ActiveXObject("Microsoft.XMLDOM")】
- Could not load NIB in bundle: 'NSBundle </Users/wyd/Library/Application Support/iPhone Simulator/5.0
- DontDestroyOnLoad(Unity3D开发之五)
- 混用Application.LoadLevel 和 PhotonNetwork.LoadLevel
- 10g & 11g Configuration of TAF(Transparent Application Failover) and Load Balancing [ID 453293.1]
- websphere6发布新的应用程序:Could not load resource "META-INF/application.xml"
- How to load "CodedUItestmethod" in another "consoleapplication".
- 10g & 11g :Configuration of TAF(Transparent Application Failover) and Load Balancing (文档 ID 453293.1