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
随机推荐
- UI1_UITabBarController
// // AppDelegate.h // UI1_UITabBarController // // Created by zhangxueming on 15/7/8. // Copyright ...
- 转载:Github 简明教程
如果你是一枚Coder,但是你不知道Github,那么我觉的你就不是一个菜鸟级别的Coder,因为你压根不是真正Coder,你只是一个Code搬运工. 但是你如果已经在读这篇文章了,我觉的你已经知道G ...
- ionic2 Navigation实现报错:No component factory found for "MyComponent"
ionic2 写的代码里面,跳转的时候报了一个 No component factory found for "RechargeSucceed" recharge() { let ...
- 8款HTML5动画特效推荐源码
1.HTML5 Canvas发光Loading动画 之前我们分享过很多基于CSS3的Loading动画效果,相信大家都很喜欢.今天我们要来分享一款基于HTML5 Canvas的发光Loading加载动 ...
- C++调用GDAL库读取并输出tif文件,并计算斑块面积输出景观指数:CSD
部分源码选自GDAL库的官方网址:www.gdal.org,其余的代码为笔者自己编写. // readfile.cpp : 定义控制台应用程序的入口点. // /* part of the codes ...
- c++学习——类成员的访问权限
成员的访问权限 Public: 任何人,尤其是那些要使用这个类库的客户程序员,都能访问那个紧跟在public 后面声明的成员. 默认的package: 在同一个目录里面的文件,并且都没有明确指明它是属 ...
- C++ 双链表基本操作
上一篇博客主要总结了单向链表,这次再总结一下双向链表. 1.概念 双向链表也叫双链表,是链表的一种,它的每个数据结点中都有两个指针,分别指向直接后继和直接前驱.所以,从双向链表中的任意一个结点开始,都 ...
- Uncaught SyntaxError: Unexpected token ILLEGAL【js错误】
应该是逗号的中英文状态错了,应该是英文状态的逗号.还有百度应用后面的逗号.college后面的冒号
- window store app 附件读取
public static async Task<bool> DisplayApplicationPicker(string folderName, string fileName) { ...
- Linux 本地yum源搭建和网络yum源搭建
一.本地yum源搭建 首先挂载上光盘 [root@www /]# mount /dev/cdrom /media/cdrom/ 系统默认已经安装了可使用yum的软件包,所以可以直接配置: [root@ ...