当前位置:网站首页>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 incident
About 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 .
边栏推荐
- Can I "reverse" a Boolean value- Can I 'invert' a bool?
- [Dalian University of technology] information sharing of postgraduate entrance examination and re examination
- Audio and video technology development weekly | 252
- Logstash ~ detailed explanation of logstash configuration (logstash.yml)
- One question per day 540 A single element in an ordered array
- Talking about Net core how to use efcore to inject multiple instances of a context annotation type for connecting to the master-slave database
- AI system content recommendation issue 24
- [book club issue 13] packaging format and coding format of audio files
- MySQL学习笔记——数据类型(2)
- 【读书会第十三期】 音频文件的封装格式和编码格式
猜你喜欢

lnx 高效搜索引擎、FastDeploy 推理部署工具箱、AI前沿论文 | ShowMeAI资讯日报 #07.04

The new generation of domestic ORM framework sagacity sqltoy-5.1.25 release

The per capita savings of major cities in China have been released. Have you reached the standard?

Case sharing | integrated construction of data operation and maintenance in the financial industry

Actual combat | use composite material 3 in application

AI has surpassed Dr. CS in question making?

数据湖治理:优势、挑战和入门

Unity脚本常用API Day03

华为云数据库DDS产品深度赋能

What is the catalog of SAP commerce cloud
随机推荐
The four most common errors when using pytorch
Unity script API - GameObject game object, object object
在芯片高度集成的今天,绝大多数都是CMOS器件
MySQL learning notes - data type (numeric type)
LeetCode 35. 搜索插入位置 —vector遍历(O(logn)和O(n)的写法---二分查找法)
Intranet penetrating FRP: hidden communication tunnel technology
谈SaaS下如何迅速部署应用软件
Understand the context in go language in an article
.Net 应用考虑x64生成
Live broadcast preview | PostgreSQL kernel Interpretation Series II: PostgreSQL architecture
Audio and video technology development weekly | 252
Digital recognition system based on OpenCV
这几年爆火的智能物联网(AIoT),到底前景如何?
mysql 联合主键_Mysql 创建联合主键[通俗易懂]
LNX efficient search engine, fastdeploy reasoning deployment toolbox, AI frontier paper | showmeai information daily # 07.04
数据湖治理:优势、挑战和入门
Common API day03 of unity script
科研漫画 | 联系到被试后还需要做什么?
Actual combat | use composite material 3 in application
[native JS] optimized text rotation effect