当前位置:网站首页>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
边栏推荐
- P3033 [usaco11nov]cow steelchase g (similar to minimum path coverage)
- MySQL reads missing data from a table in a continuous period of time
- Interface idempotency
- Network security - Security Service Engineer - detailed summary of skill manual (it is recommended to learn and collect)
- MySql数据库root账户无法远程登陆解决办法
- [Zhao Yuqiang] deploy kubernetes cluster with binary package
- 80% of the diseases are caused by bad living habits. There are eight common bad habits, which are both physical and mental
- MySQL master-slave replication
- lora网关以太网传输
- [analysis of variance] single factor analysis and multi factor analysis
猜你喜欢
User datagram protocol UDP
Basic knowledge of binary tree, BFC, DFS
Tips for using dm8huge table
Record the pit of NETCORE's memory surge
简易博客系统
阿里测试师用UI自动化测试实现元素定位
MySql數據庫root賬戶無法遠程登陸解决辦法
Serial port-rs232-rs485-ttl
SSTI template injection explanation and real problem practice
[Key shake elimination] development of key shake elimination module based on FPGA
随机推荐
ESP32_ FreeRTOS_ Arduino_ 1_ Create task
JVM的手术刀式剖析——一文带你窥探JVM的秘密
[practical exercise] face location model based on skin color
Global and Chinese markets for endoscopic drying storage cabinets 2022-2028: Research Report on technology, participants, trends, market size and share
How does technology have the ability to solve problems perfectly
C#(二十八)之C#鼠标事件、键盘事件
User datagram protocol UDP
Global and Chinese markets for patent hole oval devices 2022-2028: Research Report on technology, participants, trends, market size and share
Facebook等大廠超十億用戶數據遭泄露,早該關注DID了
Tips for using dm8huge table
MySQL reads missing data from a table in a continuous period of time
Determine which week of the month the day is
Web components series (VII) -- life cycle of custom components
Security xxE vulnerability recurrence (XXe Lab)
No qualifying bean of type ‘......‘ available
asp. Core is compatible with both JWT authentication and cookies authentication
记一次excel XXE漏洞
P2648 make money
Interface idempotency
有条件地 [JsonIgnore]