当前位置:网站首页>[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 )
边栏推荐
猜你喜欢

跟着BUU学习Crypto(周更)

Cultural tourism light show breaks the time and space constraints and shows the charm of night tour in the scenic spot

基于MobileNet-Yolov4搭建轻量化目标检测

微服务系统设计——API 网关服务设计

日志收集系统

Microservice system design -- service registration, discovery and configuration design

【C语言】关键字的补充

百度飞桨“万有引力”2022首站落地苏州,全面启动中小企业赋能计划

微服务系统设计——消息缓存服务设计

Penetration test - directory traversal vulnerability
随机推荐
1.5 use of CONDA
系统架构设计——互联网金融的架构设计
Building lightweight target detection based on mobilenet-yolov4
Penetration test - directory traversal vulnerability
math_数集(数集符号)和集合论
Fplan powerplan instance
How to systematically learn LabVIEW?
Learn crypto from Buu (Zhou Geng)
012 C语言基础:C数组
Kotlin Compose 自定义 CompositionLocalProvider CompositionLocal
List of best reading materials for machine learning in communication
A^2=e | the solution of the equation | what exactly can this equation tell us
Network structure and model principle of convolutional neural network (CNN)
Qchart note 2: add rollover display
1.5 conda的使用
[BJDCTF2020]The mystery of ip
Common sense of Apple's unique map architecture
面对AI人才培养的“产学研”鸿沟,昇腾AI如何做厚产业人才黑土地?
How to make ef core 6 support dateonly type
009 C语言基础:C循环




