当前位置:网站首页>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
边栏推荐
- Ipv4中的A 、B、C类网络及子网掩码
- Le compte racine de la base de données MySQL ne peut pas se connecter à distance à la solution
- Record the pit of NETCORE's memory surge
- 潘多拉 IOT 开发板学习(HAL 库)—— 实验9 PWM输出实验(学习笔记)
- [FPGA tutorial case 11] design and implementation of divider based on vivado core
- MySQL 中的数据类型介绍
- C language -- structs, unions, enumerations, and custom types
- C (thirty) C combobox listview TreeView
- Maxay paper latex template description
- Solution to the problem that the root account of MySQL database cannot be logged in remotely
猜你喜欢
如何修改表中的字段约束条件(类型,default, null等)
Record the pit of NETCORE's memory surge
阿里测试师用UI自动化测试实现元素定位
Database, relational database and NoSQL non relational database
P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
Proof of Stirling formula
Class A, B, C networks and subnet masks in IPv4
MySQL reads missing data from a table in a continuous period of time
C#(三十一)之自定义事件
How does technology have the ability to solve problems perfectly
随机推荐
[Zhao Yuqiang] deploy kubernetes cluster with binary package
Cf464e the classic problem [shortest path, chairman tree]
Introduction to data types in MySQL
How to execute an SQL statement in MySQL
2/10 parallel search set +bfs+dfs+ shortest path +spfa queue optimization
Tips for using dm8huge table
MySQL transaction isolation level
[American competition] mathematical terms
How does technology have the ability to solve problems perfectly
Custom event of C (31)
User datagram protocol UDP
KS008基于SSM的新闻发布系统
About some basic DP -- those things about coins (the basic introduction of DP)
STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
MySQL about self growth
Blue Bridge Cup - day of week
Detailed explanation of serialization and deserialization
DM8 backup set deletion
判断当天是当月的第几周
[FPGA tutorial case 11] design and implementation of divider based on vivado core