当前位置:网站首页>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
边栏推荐
- Detailed explanation of serialization and deserialization
- 自动化测试的好处
- [practical exercise] face location model based on skin color
- Database, relational database and NoSQL non relational database
- Global and Chinese market of rubber wheel wedges 2022-2028: Research Report on technology, participants, trends, market size and share
- Ethernet port &arm & MOS &push-pull open drain &up and down &high and low sides &time domain and frequency domain Fourier
- Introduction to data types in MySQL
- 判断当天是当月的第几周
- Custom event of C (31)
- 20、 EEPROM memory (AT24C02) (similar to AD)
猜你喜欢
cookie,session,Token 这些你都知道吗?
Error 1045 (28000): access denied for user 'root' @ 'localhost' (using password: no/yes
Record the pit of NETCORE's memory surge
Record an excel xxE vulnerability
Stack and queue
C#(二十九)之C#listBox checkedlistbox imagelist
[introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)
C form application of C (27)
P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
MySql数据库root账户无法远程登陆解决办法
随机推荐
AcWing 243. A simple integer problem 2 (tree array interval modification interval query)
Global and Chinese markets for endoscopic drying storage cabinets 2022-2028: Research Report on technology, participants, trends, market size and share
Yyds dry goods inventory hcie security Day11: preliminary study of firewall dual machine hot standby and vgmp concepts
[FPGA tutorial case 11] design and implementation of divider based on vivado core
asp. Core is compatible with both JWT authentication and cookies authentication
ESP32(基于Arduino)连接EMQX的Mqtt服务器上传信息与命令控制
Global and Chinese markets for fire resistant conveyor belts 2022-2028: Research Report on technology, participants, trends, market size and share
Redis (replicate dictionary server) cache
Python book learning notes - Chapter 09 section 01 create and use classes
Use js to complete an LRU cache
软考 系统架构设计师 简明教程 | 总目录
20、 EEPROM memory (AT24C02) (similar to AD)
阿里测试师用UI自动化测试实现元素定位
Global and Chinese markets for patent hole oval devices 2022-2028: Research Report on technology, participants, trends, market size and share
Ks003 mall system based on JSP and Servlet
C (thirty) C combobox listview TreeView
User datagram protocol UDP
Global and Chinese market of aircraft anti icing and rain protection systems 2022-2028: Research Report on technology, participants, trends, market size and share
2/12 didn't learn anything
综合能力测评系统