当前位置:网站首页>[unity] button of UI interactive component & summary of optional base classes
[unity] button of UI interactive component & summary of optional base classes
2022-06-27 04:25:00 【Rice shrimp】
Button (Button)
The button control can respond to the user's click and trigger the start or confirm operation , such as Web On the form Submit And Cancel Button . There are mainly Three attributes :Interactable / Transition / Navigation
️Interactable Property function :
Enable to make the button accept input ( There are related API file
️Transition Property function :
Visual responses to user actions can be made in some way , The specific methods and responses are as follows ( Transition options )
In the optional components , The number of transition options depends on the current state of the optional components . Different states include : normal / highlight / Press down / Ban .
Transition options : function : None The button has no status effect at all . Color Tint Change the button color according to the button state . Colors can be selected for each individual state , It can also be set between different states Fade Duration attribute . The greater the number , The slower the color fades in and out . Sprite Swap Allow different sprites to be displayed according to the current state of the button , Customizable sprites . Animation (Animation) Allow animation based on button state , An animator component must exist to use animation transitions . It is important to ensure that root motion is disabled . To create an animation controller , single click Generate Animation / Create your own , And make sure you have added an animation controller to the button's animator component . except None Each transition option outside provides additional options for controlling transitions . Each option section will be described in detail below .
️Color Tint
attribute : function : Target Graphic Graphics for interactive components . Normal Color The normal color of the control Highlighted Color The color when the control is highlighted Pressed Color The color when the control is pressed Disabled Color Control is disabled Color Multiplier This multiplies the shading color of each transition by its value . This allows you to create a larger than 1 The color of the , So that the primary color is smaller than white ( Or less than full Alpha) The color on the graphic elements of ( or Alpha passageway ) Brighten . Fade Duration The time it takes to fade in and out from one state to another ( In seconds )
️Sprite Swap
attribute : function : Target Graphic Normal sprites to use Highlighted Sprite Control to use when highlighting Pressed Sprite Control to use when pressed Disabled Sprite Control to be used when disabled
️Animation
attribute : function : Normal Trigger Normal animation trigger to use Highlighted Trigger The trigger to use when the control is highlighted Pressed Trigger The trigger to use when the control is pressed Disabled Trigger Trigger to use when the control is disabled
️Navigation Property function :
Used to determine the control order ( See navigation options for details )
attribute : function : Navigation Navigation options indicate how to control UI Element navigation in playback mode . None Keyless navigation . just so so Make sure you click / Clicking won't get focus . Horizontal lateral navigation . Vertical Vertical navigation . Automatic Automatic pilot . Explicit In this mode , You can explicitly specify where different arrow keys will navigate the control . Visualize choice Visualize It can visually display the navigation you set in the scene window .
![]()
The scene window of the visual navigation connection diagram
![]()
In the above visualization mode , Arrows indicate how to set focus changes for the entire control collection . It means , For each individual UI Control , If the user presses the arrow key when a given control has focus , You can see what will get the focus next UI Control . therefore , In the example shown above , If “Button” Has focus and the user presses the right arrow key , Is the first ( left ) The vertical slider will then gain focus . You cannot use the up or down keys to move the focus away from the vertical slider , Because these two keys are used to control the value of the slider . Horizontal slider and left / The same is true for the right arrow key .
️ event On Click Property function
When you click and release the button , call UnityEvent
️ Details
The button is used to start an operation when the user clicks and releases it . If you move the mouse away from the button control before releasing the click , The operation will not be performed .
The button has a name On Click Events , When the user finishes clicking, it will respond . Typical use cases include :
- Confirm a decision ( for example , Start the game or save the game )
- Move to GUI Submenu in
- Cancel the operation in progress ( for example , Download new scene )
边栏推荐
- 022 C语言基础:C内存管理与C命令行参数
- [数组]BM94 接雨水问题-较难
- 006 C语言基础:C存储类
- Ldr6028 OTG data transmission scheme for mobile devices while charging
- MySQL development environment
- 系统架构设计——互联网金融的架构设计
- mysql数据库基础:DQL数据查询语言
- Cultural tourism night tour | stimulate tourists' enthusiasm with immersive visual experience
- Fplan powerplan instance
- 第2章 关键技术介绍
猜你喜欢
随机推荐
Further exploration of handler (I) (the most complete analysis of the core principle of handler)
PostgreSQL基础命令教程:创建新用户admin来访问PostgreSQL
轨道姿态常用编程缩写
Knowledge of iPhone certificate structure
A^2=e | the solution of the equation | what exactly can this equation tell us
008 C language foundation: C judgment
halcon常用仿射变换算子
DAST black box vulnerability scanner part 6: operation (final)
Learn crypto from Buu (Zhou Geng)
LDR6028 手机设备一边充电一边OTG传输数据方案
006 C语言基础:C存储类
012 C语言基础:C数组
Office VR porn, coquettish operation! The father of Microsoft hololens resigns!
IOS development: understanding of dynamic library shared cache (dyld)
PostgreSQL basic command tutorial: create a new user admin to access PostgreSQL
In a sense, the Internet has become an incubator and a parent
021 C语言基础:递归,可变参数
Fplan power planning
微服务系统设计——微服务监控与系统资源监控设计
Usage knowledge of mobile phones in new fields






![[station B up dr_can learning notes] Kalman filter 2](/img/52/777f2ad2db786c38fd9cd3fe55142c.gif)







