当前位置:网站首页>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 .
边栏推荐
- One question per day 540 A single element in an ordered array
- Summary of database 2
- error: ‘connect‘ was not declared in this scope connect(timer, SIGNAL(timeout()), this, SLOT(up
- MySQL learning notes - data type (2)
- web聊天室实现
- AI has surpassed Dr. CS in question making?
- Unity脚本API—Component组件
- Width accuracy
- Temperature control system based on max31865
- 谈SaaS下如何迅速部署应用软件
猜你喜欢
Intranet penetrating FRP: hidden communication tunnel technology
.Net 应用考虑x64生成
科研漫画 | 联系到被试后还需要做什么?
[Dalian University of technology] information sharing of postgraduate entrance examination and re examination
Huawei cloud database DDS products are deeply enabled
MySQL学习笔记——数据类型(数值类型)
Big God explains open source buff gain strategy live broadcast
MySQL learning notes - data type (2)
LNX efficient search engine, fastdeploy reasoning deployment toolbox, AI frontier paper | showmeai information daily # 07.04
Redis哨兵模式实现一主二从三哨兵
随机推荐
【读书会第十三期】FFmpeg 查看媒体信息和处理音视频文件的常用方法
Feature extraction and detection 15-akaze local matching
Hexadecimal form
Weekly recruitment | senior DBA annual salary 49+, the more opportunities, the closer success!
一篇文章学会GO语言中的变量
Quelles sont les perspectives de l'Internet intelligent des objets (aiot) qui a explosé ces dernières années?
C implementation defines a set of intermediate SQL statements that can be executed across libraries
[learning notes] matroid
c# 实现定义一套中间SQL可以跨库执行的SQL语句
Stress, anxiety or depression? Correct diagnosis and retreatment
AI system content recommendation issue 24
Enter the width!
error: ‘connect‘ was not declared in this scope connect(timer, SIGNAL(timeout()), this, SLOT(up
. Net delay queue
Recommend 10 excellent mongodb GUI tools
The per capita savings of major cities in China have been released. Have you reached the standard?
Actual combat | use composite material 3 in application
MySQL学习笔记——数据类型(2)
PXE network
MySQL学习笔记——数据类型(数值类型)