当前位置:网站首页>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
边栏推荐
- Use js to complete an LRU cache
- Plus d'un milliard d'utilisateurs de grandes entreprises comme Facebook ont été compromis, il est temps de se concentrer sur le did
- [disassembly] a visual air fryer. By the way, analyze the internal circuit
- Differential GPS RTK thousand search
- 20、 EEPROM memory (AT24C02) (similar to AD)
- Global and Chinese markets for fire resistant conveyor belts 2022-2028: Research Report on technology, participants, trends, market size and share
- Mathematical modeling regression analysis relationship between variables
- 登录mysql输入密码时报错,ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/YES
- MySQL transaction isolation level
- MySQL 中的数据类型介绍
猜你喜欢
C#(二十八)之C#鼠标事件、键盘事件
登录mysql输入密码时报错,ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/YES
Plus d'un milliard d'utilisateurs de grandes entreprises comme Facebook ont été compromis, il est temps de se concentrer sur le did
《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动
[FPGA tutorial case 11] design and implementation of divider based on vivado core
DM8 backup set deletion
Custom event of C (31)
简易博客系统
Redis (replicate dictionary server) cache
JVM的手术刀式剖析——一文带你窥探JVM的秘密
随机推荐
mysql关于自增长增长问题
C#(二十七)之C#窗体应用
软考 系统架构设计师 简明教程 | 总目录
/usr/bin/gzip: 1: ELF: not found/usr/bin/gzip: 3: : not found/usr/bin/gzip: 4: Syntax error:
Class A, B, C networks and subnet masks in IPv4
记一次excel XXE漏洞
ESP32_ FreeRTOS_ Arduino_ 1_ Create task
Chinese brand hybrid technology: there is no best technical route, only better products
Database, relational database and NoSQL non relational database
About some basic DP -- those things about coins (the basic introduction of DP)
Cf603e pastoral oddities [CDQ divide and conquer, revocable and search set]
Tips for using dm8huge table
【PSO】基于PSO粒子群优化的物料点货物运输成本最低值计算matlab仿真,包括运输费用、代理人转换费用、运输方式转化费用和时间惩罚费用
Leetcode32 longest valid bracket (dynamic programming difficult problem)
Hashcode and equals
Interface idempotency
Thread sleep, thread sleep application scenarios
KS008基于SSM的新闻发布系统
使用JS完成一个LRU缓存
【按鍵消抖】基於FPGA的按鍵消抖模塊開發