当前位置:网站首页>[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 )
边栏推荐
- Microservice system design -- unified authentication service design
- 009 basics of C language: C loop
- 006 C language foundation: C storage class
- 007 C语言基础:C运算符
- [数组]BM94 接雨水问题-较难
- 016 C语言基础:C语言枚举类型
- Argo Workflows —— Kubernetes的工作流引擎入门
- Description of replacement with STM32 or gd32
- 微服务系统设计——分布式缓存服务设计
- List of best reading materials for machine learning in communication
猜你喜欢
MySql最详细的下载教程
Ledrui ldr6035 usb-c interface device supports rechargeable OTG data transmission scheme.
真xx相来了?测试/开发程序员为什么不愿意加班,这是个疯狂的状态......
fplan-电源规划
math_ Number set (number set symbol) and set theory
ERP demand and sales management Kingdee
微服务系统设计——服务熔断和降级设计
Microservice system design -- message caching service design
[BJDCTF2020]The mystery of ip
Cultural tourism light show breaks the time and space constraints and shows the charm of night tour in the scenic spot
随机推荐
微服务系统设计——微服务监控与系统资源监控设计
清华大学开源软件镜像站网址
Is the truth XX coming? Why are test / development programmers unwilling to work overtime? This is a crazy state
Microservice system design -- service registration, discovery and configuration design
Nestjs environment variable configuration to solve the problem of how to inject services into interceptors
Cache comprehensive project - seckill architecture
733. 图像渲染
012 C language foundation: C array
真xx相来了?测试/开发程序员为什么不愿意加班,这是个疯狂的状态......
Static timing analysis OCV and time derive
Microservice system design -- unified authentication service design
Installing MySQL on Windows
轨道姿态常用编程缩写
面对AI人才培养的“产学研”鸿沟,昇腾AI如何做厚产业人才黑土地?
WPF open source control library extended WPF toolkit Introduction (Classic)
微服务系统设计——分布式定时服务设计
百度飞桨“万有引力”2022首站落地苏州,全面启动中小企业赋能计划
MobileNet系列(4):MobileNetv3网络详解
Mobilenet series (4): mobilenetv3 network details
mysql数据库基础:DQL数据查询语言