当前位置:网站首页>Script lifecycle
Script lifecycle
2022-07-06 04:05:00 【A plum in fall】
List of articles
Preface
MonoBehaviour Class defines a script file to be loaded from the beginning , To the final destruction of a complete process . This process , Through corresponding methods , Perform functions that cannot be done in different ways .
We call these methods : Methods related to script life cycle .
One 、 Initialize the relevant methods
Awake()
Called automatically when the script is loaded into the scene
Only execute once in the whole life cycle
OnEnable()
Called when the object becomes available or active , Determine whether the object or script is available
coordination OnDisable() Methods used together
The number of executions is uncertain
Start()
for the first time Update Previous call
Only execute once in the whole life cycle , Used for initialization
Two 、 Update relevant methods
FixedUpdate()
Fixed update
Refresh the scene in frames , Refresh at fixed intervals
Physical related update operations , Put it in FixedUpdate() complete
Update()
to update
The execution time of each frame may be inconsistent with that of each frame
Update() The execution rate is related to hardware devices and rendered objects , Sometimes fast, sometimes slow
It mainly completes the update of data in the scene and the logical processing of data
LateUpdate()
Update later
When a frame execution ends , Before preparing for the next frame execution , This method is called
OnGUI()
Rendering and processing GUI event
3、 ... and 、 Destruction related methods
OnDisable()
When an object or script is unavailable ( Or inactive ) When the
Execute several times indefinitely
It's usually related to OnEnable() In combination with
OnDestory()
Only execute once in the whole life cycle
Be the object ( Script files ) Only execute this method when destroyed
Generally, it will be executed first OnDisable(), Make the object unavailable , And then destroy
边栏推荐
- Conditionally [jsonignore]
- Leetcode32 longest valid bracket (dynamic programming difficult problem)
- P3033 [usaco11nov]cow steelchase g (similar to minimum path coverage)
- [Key shake elimination] development of key shake elimination module based on FPGA
- mysql关于自增长增长问题
- Facebook等大厂超十亿用户数据遭泄露,早该关注DID了
- JVM的手术刀式剖析——一文带你窥探JVM的秘密
- 阿里测试师用UI自动化测试实现元素定位
- /usr/bin/gzip: 1: ELF: not found/usr/bin/gzip: 3: : not found/usr/bin/gzip: 4: Syntax error:
- 脚本生命周期
猜你喜欢
P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
登录mysql输入密码时报错,ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/YES
Database, relational database and NoSQL non relational database
C#(三十)之C#comboBox ListView treeView
JVM的手术刀式剖析——一文带你窥探JVM的秘密
Maxay paper latex template description
C#(二十九)之C#listBox checkedlistbox imagelist
An article will give you a comprehensive understanding of the internal and external components of "computer"
如何修改表中的字段约束条件(类型,default, null等)
Blue Bridge Cup - Castle formula
随机推荐
[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
在 .NET 6 中使用 Startup.cs 更简洁的方法
Global and Chinese market of rubber wheel wedges 2022-2028: Research Report on technology, participants, trends, market size and share
10个 Istio 流量管理 最常用的例子,你知道几个?
KS003基于JSP和Servlet实现的商城系统
2/11 matrix fast power +dp+ bisection
Record an excel xxE vulnerability
使用JS完成一个LRU缓存
asp. Core is compatible with both JWT authentication and cookies authentication
How to modify field constraints (type, default, null, etc.) in a table
No qualifying bean of type ‘......‘ available
Facebook and other large companies have leaked more than one billion user data, and it is time to pay attention to did
WPF效果第一百九十一篇之框选ListBox
cookie,session,Token 这些你都知道吗?
Fundamentals of SQL database operation
C (XXIX) C listbox CheckedListBox Imagelist
51nod 1130 n factorial length V2 (Stirling approximation)
C (thirty) C combobox listview TreeView
MySql數據庫root賬戶無法遠程登陸解决辦法
MySQL about self growth