当前位置:网站首页>绑定在游戏对象上的脚本的执行顺序
绑定在游戏对象上的脚本的执行顺序
2022-07-06 04:01:00 【A plum in fall】
文章目录
1.一个游戏对象只能绑定一个脚本吗?
不,一个游戏对象可以绑定多个脚本。
2.如果一个游戏对象可绑定多个脚本,那么哪个脚本先执行呢?哪个最后执行?
最先拖动到游戏对象上的脚本文件,最后执行;
最后拖动到游戏对象上的脚本文件,最先执行。
3.场景中如果存在多个游戏对象,多个游戏对象身上都绑定了脚本文件,执行顺序又是怎样的?
不管场景中有几个对象,对象身上绑定了几个脚本
真正决定脚本执行顺序的是:拖动的顺序
先拖动到对象上的脚本,最后执行;
最后拖动到对象上的脚本,最先执行。
总结
正常情况下,脚本的执行顺序是根据拖动脚本的顺序来执行最先拖动到对象上的后执行,后拖动的先执行。
但是,实际项自中脚本文件比较多,而且开发人员不可能一直记得拖动的顺序,这时,可使用界面化的操作来管理脚本的执行顺序。
单击任何一个脚本文件,Inspector的右上角位置,有一个order按钮
点开按钮,选择“+“号图标当前项目下所有脚本文件,需要哪个就点击。
添加的每个脚本项后面有一个数字,数字越小,表示脚本会越先执行。
通过界面设置脚本的执行顺序后,再执行。会发现,是以界面中设置的顺序为执行依据的。
边栏推荐
- Indicator system of KQI and KPI
- [matlab] - draw a five-star red flag
- [introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)
- asp. Core is compatible with both JWT authentication and cookies authentication
- math_极限&微分&导数&微商/对数函数的导函数推导(导数定义极限法)/指数函数求导公式推导(反函数求导法则/对数求导法)
- [prediction model] difference method model
- Ks003 mall system based on JSP and Servlet
- Proof of Stirling formula
- 【PSO】基于PSO粒子群优化的物料点货物运输成本最低值计算matlab仿真,包括运输费用、代理人转换费用、运输方式转化费用和时间惩罚费用
- How to execute an SQL statement in MySQL
猜你喜欢
![[FPGA tutorial case 11] design and implementation of divider based on vivado core](/img/39/f337510c2647d365603a8485583a20.png)
[FPGA tutorial case 11] design and implementation of divider based on vivado core

UDP reliable transport protocol (quic)

WPF效果第一百九十一篇之框选ListBox

Align items and align content in flex layout

Multi project programming minimalist use case

Simple blog system

C#(三十)之C#comboBox ListView treeView

Factors affecting user perception

How do we make money in agriculture, rural areas and farmers? 100% for reference

Facebook等大厂超十亿用户数据遭泄露,早该关注DID了
随机推荐
Stack and queue
MySql數據庫root賬戶無法遠程登陸解决辦法
[prediction model] difference method model
TCP/IP协议里面的网关地址和ip地址有什么区别?
Cf603e pastoral oddities [CDQ divide and conquer, revocable and search set]
简易博客系统
How does technology have the ability to solve problems perfectly
Global and Chinese market of plasma separator 2022-2028: Research Report on technology, participants, trends, market size and share
[analysis of variance] single factor analysis and multi factor analysis
Mathematical modeling regression analysis relationship between variables
[American competition] mathematical terms
LTE CSFB test analysis
[FPGA tutorial case 12] design and implementation of complex multiplier based on vivado core
自动化测试的好处
Pandora IOT development board learning (HAL Library) - Experiment 9 PWM output experiment (learning notes)
An article will give you a comprehensive understanding of the internal and external components of "computer"
Take you to wechat applet development in 3 minutes
[adjustable delay network] development of FPGA based adjustable delay network system Verilog
[introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)
Why do you want to start pointer compression?