当前位置:网站首页>绑定在游戏对象上的脚本的执行顺序
绑定在游戏对象上的脚本的执行顺序
2022-07-06 04:01:00 【A plum in fall】
文章目录
1.一个游戏对象只能绑定一个脚本吗?
不,一个游戏对象可以绑定多个脚本。
2.如果一个游戏对象可绑定多个脚本,那么哪个脚本先执行呢?哪个最后执行?
最先拖动到游戏对象上的脚本文件,最后执行;
最后拖动到游戏对象上的脚本文件,最先执行。
3.场景中如果存在多个游戏对象,多个游戏对象身上都绑定了脚本文件,执行顺序又是怎样的?
不管场景中有几个对象,对象身上绑定了几个脚本
真正决定脚本执行顺序的是:拖动的顺序
先拖动到对象上的脚本,最后执行;
最后拖动到对象上的脚本,最先执行。
总结
正常情况下,脚本的执行顺序是根据拖动脚本的顺序来执行最先拖动到对象上的后执行,后拖动的先执行。
但是,实际项自中脚本文件比较多,而且开发人员不可能一直记得拖动的顺序,这时,可使用界面化的操作来管理脚本的执行顺序。
单击任何一个脚本文件,Inspector的右上角位置,有一个order按钮
点开按钮,选择“+“号图标当前项目下所有脚本文件,需要哪个就点击。
添加的每个脚本项后面有一个数字,数字越小,表示脚本会越先执行。
通过界面设置脚本的执行顺序后,再执行。会发现,是以界面中设置的顺序为执行依据的。
边栏推荐
- [Massey] Massey font format and typesetting requirements
- Ethernet port &arm & MOS &push-pull open drain &up and down &high and low sides &time domain and frequency domain Fourier
- Take you to wechat applet development in 3 minutes
- C#(二十八)之C#鼠标事件、键盘事件
- User perceived monitoring experience
- C (XXIX) C listbox CheckedListBox Imagelist
- The Research Report "2022 RPA supplier strength matrix analysis of China's banking industry" was officially launched
- Scalpel like analysis of JVM -- this article takes you to peek into the secrets of JVM
- 使用JS完成一个LRU缓存
- How does technology have the ability to solve problems perfectly
猜你喜欢

Web components series (VII) -- life cycle of custom components

Blue Bridge Cup - day of week

JVM的手术刀式剖析——一文带你窥探JVM的秘密

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

C (XXIX) C listbox CheckedListBox Imagelist

Facebook等大厂超十亿用户数据遭泄露,早该关注DID了

RT thread -- FTP of LwIP (2)
![[PSO] Based on PSO particle swarm optimization, matlab simulation of the calculation of the lowest transportation cost of goods at material points, including transportation costs, agent conversion cos](/img/41/27ce3741ef29e87c0f3b954fdef87a.png)
[PSO] Based on PSO particle swarm optimization, matlab simulation of the calculation of the lowest transportation cost of goods at material points, including transportation costs, agent conversion cos

TCP/IP协议里面的网关地址和ip地址有什么区别?

记一次excel XXE漏洞
随机推荐
Pandora IOT development board learning (HAL Library) - Experiment 9 PWM output experiment (learning notes)
No qualifying bean of type ‘......‘ available
Record the pit of NETCORE's memory surge
Viewing and verifying backup sets using dmrman
Basic concepts of LTE user experience
Facebook等大廠超十億用戶數據遭泄露,早該關注DID了
WPF效果第一百九十一篇之框选ListBox
Blue Bridge Cup - day of week
Why do you want to start pointer compression?
[meisai] meisai thesis reference template
Error 1045 (28000): access denied for user 'root' @ 'localhost' (using password: no/yes
Cf464e the classic problem [shortest path, chairman tree]
mysql从一个连续时间段的表中读取缺少数据
[adjustable delay network] development of FPGA based adjustable delay network system Verilog
Containerization Foundation
Codeforces Global Round 19
Facebook and other large companies have leaked more than one billion user data, and it is time to pay attention to did
Class A, B, C networks and subnet masks in IPv4
Align items and align content in flex layout
KS008基于SSM的新闻发布系统