当前位置:网站首页>Common knowledge of unity Editor Extension
Common knowledge of unity Editor Extension
2022-07-04 16:06:00 【jjegoing】
OnGUI When to call a function
OnGUI The function is called at least twice in each frame ,OnGUI Yes Event Respond to events , among layout and repaint Events are executed at least once per frame .Events Types include mouse clicks 、 Mouse drag 、 Press the button 、 The mouse enters or exits the window 、 Rollers and other types mentioned below . For each event , Call... In these scripts OnGUI; Therefore, each frame may be called many times OnGUI. Event.current Corresponding to OnGUI Within call “ At present ” event . The occurrence of these events will lead to OnGUI Function called .
Besides , Found through official documents ,layout The event will be sent before any other event .
Found by test , No matter how the user operates, some events will happen , Before that, it will lead to layout The occurrence of the incidentAbout layout Refer to this article for the introduction class of
Personal understanding is in layout In the event GUI The layout of the elements , And then Repant Draw in the event .Use AnimBool as well as EditorGUILayout.BeginFadeGroup To reach the editor GUI Animation effect of
Note the following statement :
m_ShowExtraFields.valueChanged.AddListener(Repaint);
At this time value yes bool type , Not true namely false, At first, I thought it was when value The event is triggered when the value of is switched , By calling Repaint Callback .
Found by test , When faded This event will be triggered when the value changes . So when window Interface Click √ when ,fade From
0 adopt lerp Change to 1, The process of change will trigger Repaint Method's callback ,Repaint Will trigger Event.repaint Events ,Event.repaint It can lead to OnGUI Execution of a function .
Incoming AnimBool Of fade Value can make window Upper GUI Achieve the animation effect from never displaying to fully displaying .
边栏推荐
- MYSQL索引优化
- Shell 编程基础
- AutoCAD - set color
- unity update 协程_Unity 协程的原理
- 干货 | fMRI标准报告指南新鲜出炉啦,快来涨知识吧
- JS tile data lookup leaf node
- 中国主要城市人均存款出炉,你达标了吗?
- 在芯片高度集成的今天,绝大多数都是CMOS器件
- Live broadcast preview | PostgreSQL kernel Interpretation Series II: PostgreSQL architecture
- What does IOT engineering learn and work for?
猜你喜欢
[native JS] optimized text rotation effect
[Dalian University of technology] information sharing of postgraduate entrance examination and re examination
Understand Alibaba cloud's secret weapon "dragon architecture" in the article "science popularization talent"
What is the future of the booming intelligent Internet of things (aiot) in recent years?
Function test - knowledge points and common interview questions
Unity script lifecycle day02
MySQL学习笔记——数据类型(2)
Audio and video technology development weekly | 252
Scientific research cartoon | what else to do after connecting with the subjects?
Book of night sky 53 "stone soup" of Apache open source community
随机推荐
[native JS] optimized text rotation effect
Width and alignment
. Net delay queue
Unity脚本API—Component组件
Stress, anxiety or depression? Correct diagnosis and retreatment
Neuf tendances et priorités du DPI en 2022
Essential basic knowledge of digital image processing
Scientific research cartoon | what else to do after connecting with the subjects?
[hcie TAC] question 5 - 1
AutoCAD - set color
2022年九大CIO趋势和优先事项
PR FAQ: how to set PR vertical screen sequence?
hexadecimal
Blood cases caused by Lombok use
Will the memory of ParticleSystem be affected by maxparticles
In today's highly integrated chips, most of them are CMOS devices
函数式接口,方法引用,Lambda实现的List集合排序小工具
How to save the contents of div as an image- How to save the contents of a div as a image?
怎么判断外盘期货平台正规,资金安全?
Width accuracy