Unity3D Script Execution Order ——Question
我 知道 Monobehaviour 上的 那些 event functions 是 在主线程 中 按 顺序调用的。这点从Manual/ExecutionOrder.html 上的 一张图就可以看出来。
既然按 顺序 调用,那么 如果 比如update 在这一次 调用的 时候 执行 了 大量的运算 导致 主线程 被堵塞。是不是 意味着 这之后的 event funstion 也被堵塞了。
测试一下:
using UnityEngine;
using System.Collections; public class mTest : MonoBehaviour { //public GameObject tmp; int index1 = ;
void FixedUpdate()
{
Debug.Log(" mTest FixedUpdate " + Time.realtimeSinceStartup + " index1 : " + (index1++));
} int index = ; // Update is called once per frame
void Update () { if (index == )
{
for (int i = ; i < ; i++)
{
Debug.Log("nothing");
}
//Destroy(tmp);
//Debug.Log("test");
}
Debug.Log(" mTest Update " + Time.realtimeSinceStartup + " index : " + (index++));
} void LateUpdate()
{
Debug.Log(" mTest LateUpdate " + Time.realtimeSinceStartup);
}
}
上结果:
结果很奇怪,的确是堵塞了,但是FixUpdate 在 第 2 帧 被 执行多次。无语了。

Unity3D Script Execution Order ——Question的更多相关文章
- unity 脚本执行顺序设置 Script Execution Order Settings
通过Edit->Project Settings->Script Execution Order打开MonoManager面板 或者选择任意脚本在Inspector视图中点击Execu ...
- Execution Order of Event Functions
In Unity scripting, there are a number of event functions that get executed in a predetermined order ...
- Unity3D Script KeynoteII
[Unity3D Script KeynoteII] 1.使用代码操作Particle. //粒子对象 GameObject particle = null; //粒子X轴方向速度 float vel ...
- Unity3D Script Keynote
[Unity3D Script Keynote] 1.创建GameObject if(GUILayout.Button("创建立方体",GUILayout.Height(50))) ...
- Execution Order for the ApiController
Execution Order for the ApiController Assuming the request goes into the ApiController scope, the op ...
- Increase PHP script execution time with Nginx
If you have a large WordPress setup or a server with limited resources, then you will often see the ...
- [Javascript]2. Improve you speed! Script Execution
Let's take a closer look at how a browser retrieves and acts on scripts.modern browser can parallel ...
- Test execution order
刚开始的时候,JUnit并没有规定测试方法的调用执行顺序.方法通过映射的API返回的顺序进行调用.然 而,使用JVM顺序是不明智的,因为Java平台没有规定任何特定的顺序,事实上JDK7或多或少的返回 ...
- Execution Order In a Test Plan
1.Config Element 2.Pre Processors 3.Timer 4.Sampler 5.Post Processors 6.Assertions 7.Listener
随机推荐
- Mysql 格式化日期格式
DATE_FORMAT(date, format) 根据格式串format 格式化日期或日期和时间值date,返回结果串. 可用DATE_FORMAT( ) 来格式化DATE 或DATETIME 值, ...
- 8套迷人精致的CSS3 3D按钮动画
1.纯CSS3 3D按钮 按钮酷似牛奶般剔透 CSS3按钮一般都可以设计的非常漂亮,利用投影.渐变等CSS3属性特效可以把按钮渲染的十分动感.今天分享的这款CSS3按钮外观非常特别,它看上去酷似晶莹剔 ...
- android 数据库_sql语句总结
表的创建db.execSQL("create table info(_id integer primary key autoincrement,name varchar(20)") ...
- DataGrid2
1.DataGrid的button属性设置 CommandName="ToEdit": 对其中的button按钮进行选择: CommandArgument='<%#Eval( ...
- Java设计模式之--代理模式学习
1.代理模式定义 为其他对象提供一种代理以控制对这个对象的访问.代理对象起到中介服务,可以去掉功能服务和增加额外的服务. 其实按照官方的说法可能不太好理解,代理模式就好比我们生活中买票,一般情况下我们 ...
- solr6安装部署
难得写篇自己的原创文档了,哈哈哈,原谅我知识浅薄,积淀太少 一.涉及到的软件和环境jdk1.8.0_92,tomcat8,zookeeper3.4.8,solr6.1.0(solr6需要jdk8以上环 ...
- HTML5-draggable(拖放)
<!DOCTYPE html> <html class="no-js" ...
- nodejs ssh2
https://www.npmjs.com/package/ssh2 npm install ssh2 ssh2文件下载: //前台命令下发 app.get('/test/fileDownload' ...
- Stanford parser学习:LexicalizedParser类分析
上次(http://www.cnblogs.com/stGeekpower/p/3457746.html)主要是对应于javadoc写了下LexicalizedParser类main函数的功能,这次看 ...
- apache 配置虚拟主机
1 打开httpd.conf 找到 # Virtual hosts #Include conf/extra/httpd-vhosts.conf [由于apache的版本不同,可能你ctrl+F ...