当前位置:网站首页>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
边栏推荐
- Basic knowledge of binary tree, BFC, DFS
- math_ Derivative function derivation of limit & differential & derivative & derivative / logarithmic function (derivative definition limit method) / derivative formula derivation of exponential functi
- asp. Core is compatible with both JWT authentication and cookies authentication
- Ethernet port &arm & MOS &push-pull open drain &up and down &high and low sides &time domain and frequency domain Fourier
- Thread sleep, thread sleep application scenarios
- 《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动
- Detailed explanation of serialization and deserialization
- mysql关于自增长增长问题
- Exchange bottles (graph theory + thinking)
- C (thirty) C combobox listview TreeView
猜你喜欢
MySQL reads missing data from a table in a continuous period of time
In Net 6 CS more concise method
About some basic DP -- those things about coins (the basic introduction of DP)
20、 EEPROM memory (AT24C02) (similar to AD)
[introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)
[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
[disassembly] a visual air fryer. By the way, analyze the internal circuit
C form application of C (27)
Scalpel like analysis of JVM -- this article takes you to peek into the secrets of JVM
DM8 archive log file manual switching
随机推荐
Cf603e pastoral oddities [CDQ divide and conquer, revocable and search set]
lora网关以太网传输
Mathematical modeling regression analysis relationship between variables
Plus d'un milliard d'utilisateurs de grandes entreprises comme Facebook ont été compromis, il est temps de se concentrer sur le did
Global and Chinese markets for otolaryngology devices 2022-2028: Research Report on technology, participants, trends, market size and share
P2648 make money
Yyds dry goods inventory web components series (VII) -- life cycle of custom components
Scalpel like analysis of JVM -- this article takes you to peek into the secrets of JVM
Custom event of C (31)
Ethernet port &arm & MOS &push-pull open drain &up and down &high and low sides &time domain and frequency domain Fourier
脚本生命周期
IDEA编译JSP页面生成的class文件路径
Chinese brand hybrid technology: there is no best technical route, only better products
C#(三十一)之自定义事件
Facebook and other large companies have leaked more than one billion user data, and it is time to pay attention to did
绑定在游戏对象上的脚本的执行顺序
P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
How to modify field constraints (type, default, null, etc.) in a table
Conditionally [jsonignore]
asp. Core is compatible with both JWT authentication and cookies authentication