纳金网

标题: [Unity 组件参考手册]组件:管理器设置之脚本执行顺序设置 [打印本页]

作者: .    时间: 2013-1-31 22:52
标题: [Unity 组件参考手册]组件:管理器设置之脚本执行顺序设置
By default, the Awake, OnEnable and Update functions of different scripts are called in the order the scripts are loaded (which is arbitrary). However, it is possible to modify this order using the Script Execution Order settings.默认情况下,不同的脚本的Awake,OnEnable,Update函数根据脚本的加载顺序来依次调用(脚本的加载顺序是不确定的)。我们可以通过设置脚本执行顺序来改变它。Scripts can be added to the inspector using the Plus "+" button and dragged to change their relative order. Note that it is possible to drag a script either above or below the Default Time bar; those above will&nbsp***cute ahead of the default time while those below will&nbsp***cute after. The ordering of scripts in the dialog from top to bottom determines their&nbsp***cution order. All scripts not in the dialog&nbsp***cute in the default time slot in arbitrary order.脚本可以使用加号"+"按钮添加到检视面板,可以拖动以改变脚本顺序。注意,脚本可以拖到默认时间段的上方或下方。默认时间段上方的脚本将提前执行,下方的脚本将延后执行。对话框中显示的脚本将按从上到下的顺序执行。不在对话框中的脚本将在默认时间段中以不确定顺序执行。【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/




欢迎光临 纳金网 (http://rs.narkii.com/club/) Powered by Discuz! X2.5