我 知道 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的更多相关文章

  1. unity 脚本执行顺序设置 Script Execution Order Settings

     通过Edit->Project Settings->Script Execution Order打开MonoManager面板  或者选择任意脚本在Inspector视图中点击Execu ...

  2. Execution Order of Event Functions

    In Unity scripting, there are a number of event functions that get executed in a predetermined order ...

  3. Unity3D Script KeynoteII

    [Unity3D Script KeynoteII] 1.使用代码操作Particle. //粒子对象 GameObject particle = null; //粒子X轴方向速度 float vel ...

  4. Unity3D Script Keynote

    [Unity3D Script Keynote] 1.创建GameObject if(GUILayout.Button("创建立方体",GUILayout.Height(50))) ...

  5. Execution Order for the ApiController

    Execution Order for the ApiController Assuming the request goes into the ApiController scope, the op ...

  6. 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 ...

  7. [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 ...

  8. Test execution order

    刚开始的时候,JUnit并没有规定测试方法的调用执行顺序.方法通过映射的API返回的顺序进行调用.然 而,使用JVM顺序是不明智的,因为Java平台没有规定任何特定的顺序,事实上JDK7或多或少的返回 ...

  9. Execution Order In a Test Plan

    1.Config Element 2.Pre  Processors 3.Timer 4.Sampler 5.Post Processors 6.Assertions 7.Listener

随机推荐

  1. DFS入门之二---DFS求连通块

    用DFS求连通块也是比较典型的问题, 求多维数组连通块的过程也称为--“种子填充”. 我们给每次遍历过的连通块加上编号, 这样就可以避免一个格子访问多次.比较典型的问题是”八连块问题“.即任意两格子所 ...

  2. WFP: 读取XPS文件或将word、txt文件转化为XPS文件

    读取XPS格式文件或将doc,txt文件转化为XPS文件,效果图如下: 1.XAML页面代码: <Window x:Class="WpfWord.MainWindow"    ...

  3. Ubuntu下设置Tomcat成为服务(开机启动)

    1.将tomcat安装目录下bin文件夹中的catalina.sh拷贝到/etc/init.d下并修改名称为tomcat cp  /path/to/tomcat/bin/catalina.sh /et ...

  4. jQuery实现公告文字左右滚动

    jQuery实现公告文字左右滚动的代码. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &qu ...

  5. WinFrom下连接字符串的数据库文件路径问题

    一直以为连接字符串中的系统变量|DataDirectory|就是在ASP.NET中代替App_Data的绝对路径.原来在WinForm程序中也能用|DataDirectory|,不过指代的是exe文件 ...

  6. 如何重建Octopress本地环境

    # 安装rvm, ruby, bundler 略 # 克隆octopress $ git clone git://github.com/imathis/octopress.git octopress ...

  7. 《深入浅出WPF》重点摘要(—)Binding自动通知机制

    最近因为公司的项目需要用WPF开发,就学习了一下WPF.刚开始只是用到什么就百度什么,虽然功能是实现了,但还是没有弄清楚原理(如果不弄清原理,会感觉很心虚,整个人会没底气),所以决定找个教程系统地学一 ...

  8. javascript和jquery 获取触发事件的元素

    一个很简单的问题,却因为大意,经常忘了处理,导致程序运行出错. <!DOCTYPE html> <html> <head> <meta charset=&qu ...

  9. (转)Windows驱动编程基础教程

    版权声明     本书是免费电子书. 作者保留一切权利.但在保证本书完整性(包括版权声明.前言.正文内容.后记.以及作者的信息),并不增删.改变其中任何文字内容的前提下,欢迎任何读者 以任何形式(包括 ...

  10. php中使用linux命令四大步骤

    一.PHP中调用外部命令介绍在PHP中调用外部命令,可以用,1>调用专门函数.2>反引号.3>popen()函数打开进程,三种方法来实现: 方法一:用PHP提供的专门函数(四个):P ...