Application.LoadLevel & Object.DontDestroyOnLoad
【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
Application.LoadLevel & Object.DontDestroyOnLoad的更多相关文章
- jexus System.BadImageFormatException Details: Non-web exception. Exception origin (name of application or object): App_global.asax_ai3fjolq.
Application ExceptionSystem.BadImageFormatExceptionInvalid method header format 0Description: HTTP 5 ...
- Kippo-Failed to load application: 'module' object has no attribute 'IPluggableAuthenticationModules'
Kippo-Failed to load application: 'module' object has no attribute 'IPluggableAuthenticationModules' ...
- Unity3D Object.DontDestroyOnLoad 备忘
初学Untiy3D,记录备忘. public static void DontDestroyOnLoad(Object target); Makes the object target not be ...
- 混用Application.LoadLevel 和 PhotonNetwork.LoadLevel
最近这一周从上周五晚上加完班回家夜里都12点了. 又赶紧送孩子去儿童医院 .. 就肺炎住院了. 真是有啥别有病呢. 悲剧的是我周三夜里陪了一夜后. 转天晚上也发烧了.. 周四 周五输了两天液. ...
- Application.LoadLevel
Unity在场景切换之间清理下内存 http://www.cnblogs.com/dongz888/p/4920714.html
- unity3d 场景间数据传递
在游戏项目中,常常会使用到用户信息,获取信息当然可以从数据库中获取.但是对场景多的游戏这样做是不正确的,那么我我们就需要再第一次获取用户信息之后, 同时在其它的场景中共享用户数据,避免对服务器增加负担 ...
- u3d DontDestroyOnLoad多场景问题
using UnityEngine; using System.Collections; public class DontDel : MonoBehaviour { public GameObjec ...
- unity3d中的DontDestroyOnLoad来回切换出现多个实例问题
在用Unity3D开发游戏中,我们会经常创建多个场景,但是在场景过度的时候,通常场景中的对象会被删除.所以Unity3D给了我们一个不删除前一个 场景中的某一个对象或者脚本的API,那就是“DontD ...
- 使用Microsoft Web Application Stress Tool对web进行压力测试
Web压力测试是目前比较流行的话题,利用Web压力测试可以有效地测试一些Web服务器的运行状态和响应时间等等,对于Web服务器的承受力测试是个非常好的手法.Web 压力测试通常是利用一些工具,例如微软 ...
随机推荐
- modelsim仿真常用系统函数
(1)$time 作用:返回所在模块的仿真时间,可以查看信号的出现的时间,用来把握信号的时序. 如:$display(''the time is %t'',$time) ;//显示当时的时间 (2)$ ...
- 【DUBBO】Dubbo:monitor的配置
[一]:配置项 <dubbo:monitor protocol="registry"/> [二]:配置解析器-->具体解析器为com.alibaba.dubbo. ...
- Python 3 利用 Dlib 实现人脸检测和剪切
0. 引言 利用 Python 开发,借助 Dlib 库进行人脸检测 / face detection 和剪切: 1. crop_faces_show.py : 将检测到的人脸剪切下来,依次排序平 ...
- c++深拷贝/浅拷贝
拷贝构造函数,是一种特殊的构造函数,它由编译器调用来完成一些基于同一类的其他对象的构建及初始化.其唯一的参数(对象的引用)是不可变的(const类型).此函数经常用在函数调用时用户定义类型的值传递及返 ...
- [语法]C语言中二维数组做输入参数
C语言中二维数组做输入参数时, 可以同时指定各维长度, 可以只指定第二维的长度, 不可以只指定第一维的长度, 不可以各维长度都不指定. 一句话总结:要指定至少指定第二维,都不指定是不行的. 具体栗子如 ...
- Web 漏洞分析与防御之 CSRF(二)
原文地址:Web 漏洞分析与防御之 CSRF(二) 博客地址:http://www.extlight.com 一.全称 跨站请求伪造(Cross-site Request Forgery) 二.原理 ...
- 教你30分钟学会XAML
1.狂妄的WPF 相对传统的Windows图形编程,需要做很多复杂的工作,引用许多不同的API.例如:WinForm(带控件表单).GDI+(2D图形).DirectX API(3D图形)以及流媒体和 ...
- Oracle修改字段值包含&字符
昨天在更新一个表的字段时发现pl/sql弹出变量框,它认为我要改的字段值中包含未定义的变量.比如我执行一个脚本: update t_wlf_config set configvalue = 'hell ...
- golang的slice作为函数参数传值的坑
直接贴代码 func sliceModify(slice []int) { // slice[0] = 88 slice = append(slice, ) } func main() { slice ...
- HttpURLConnection的使用步骤
创建一个URL对象: URL url = new URL(http://www.baidu.com); 调用URL对象的openConnection( )来获取HttpURLConnection对象实 ...