Unity UGUI system combing - interactive components

overview

Interaction components in unity can be used to handle interactions such as mouse or touch events as well as interactions using the keyboard or controller
insert image description here

1. Button

Detailed explanation of Button

2. Switch (Toggle)

insert image description hereinsert image description here

Background: background image, controls the background color change of the toggle component, so as to show the effect of whether the object is selected;
Checkmark: is the check mark check box we see on the interface, the check mark image can be replaced or deleted.
Label: text component: text output box, we can enter text here to explain the function or name of this Toggle;

insert image description hereinsert image description here

3. Toggle Group

Switch groups can be used to combine a set of mutually exclusive switches. Switches belonging to the same group are constrained that only one of them can be selected at a time: selecting one automatically deselects all others.
Toggle Group is a non-visual functional component. Multiple Toggles belonging to the same Toggle Group cannot be created directly from the right-click UI
insert image description herethrough mounting. Toggle Groups can be mounted on any object, not necessarily a sub-object of Canvas.
Make an empty object, mount Toogle Group on the empty object, and put Toogle in it.
insert image description hereThere is an attribute in Toggle: Group. Dragging the specified Toggle Group in means that the Toggle belongs to the Toggle Group.
insert image description hereinsert image description hereAllow Switch Off Checking can be thought of as a single selection. After removing the check, selecting one of the switches will automatically deselect all other switches, which will become invalid (multiple selection)

4. Slider

insert image description here
insert image description hereinsert image description here

5. Scrollbar

insert image description heredetailed introduction

Unity-UI-Scrollbar component

6. Dropdown

This control displays the currently selected option. When clicked, this control opens a list of options so a new option can be selected. After selecting a new option, the list closes again and the control displays the newly selected option. If the user clicks on the control itself or anywhere else within the canvas, the list will also close.

insert image description here
insert image description hereinsert image description here
https://docs.unity3d.com/cn/2020.3/Manual/script-Dropdown.html

7. Input Field

insert image description here
insert image description hereinsert image description hereinsert image description here

insert image description here

8. Scroll Rect

For a detailed explanation, see UGUI Scroll Rect Scrolling Rectangle Component
insert image description here

Guess you like

Origin blog.csdn.net/Brave_boy666/article/details/130668304