您的位置:首页 > 移动开发 > Unity3D

Unity3D说明文档翻译-Interaction Components

2017-03-29 13:46 781 查看

Interaction Components

组件交互

This section covers components in the UI system that handles interaction, such as mouse or touch events and interaction using a keyboard or controller.

这节介绍了UI系统内的组件交互操纵,诸如鼠标或触摸事件和使用键盘或控制器的交互.

The interaction components are not visible on their own, and must be combined with one or morevisual elements in
order to work correctly.

组件交互自身不可见,而必须和一个或多个可见元素联合才可正确工作.

Common Functionality

通用功能

Most of the interaction components have some things in common. They are selectables, which means they have shared built-in functionality for visualising transitions between states (normal, highlighted, pressed, disabled),
and for navigation to other selectables using keyboard or controller. This shared functionality is described on the Selectable page.

大部分组件交互有一些相同的东西.它们是可选的,意味着它们分享内建功能用于使状态(正常,高亮,按下,不可用)间的转换可见,和用于导航到其他可选,使用键盘或控制器.共享功能在”可选”页面描述.

Button

按钮

A Button has an OnClick UnityEvent to define what it will do when clicked.

一个按钮有一个OnClick Unity事件以定义当点击时它将做什么.

See the Button page for details on using the Button component.

查看”按钮”页面获取使用按钮组件的详细信息.

Toggle

开关

A Toggle has an Is On checkbox that determines whether the Toggle is currently on or off. This value is flipped when the
user clicks the Toggle, and a visual checkmark can be turned on or off accordingly. It also has an OnValueCHanged UnityEvent to define what it will do when the
value is changed.

一个开关有一个IsOn复选框确定触发器是开还是关.当用户点击开关值反转,且一个可视化的钩形符号可相应的开或关.也有一个OnValueChanged Unity事件以定义当值改变时它将做什么.

See the Toggle page for details on using the Toggle component.

查看”开关”页面获取使用开关组件的详情.

Toggle Group

开关组

A Toggle Group can be used to group a set of Toggles that are mutually exclusive. Toggles that belong
to the same group are constrained so that only one of them can be selected at a time - selecting one of them automatically deselects all the others.

一个开关组可用于分组一组相互排斥的开关.属于一个组开关是被约束的因此一次只有其中之一可被选中--选定其中一个自动取消其他所有选择.

See the Toggle Group page for details on using the Toggle Group component.

查看”开关组”页面获取使用开关组组件详情.

Slider

滑块

A Slider has a decimal number Value that the user can drag between a minimum and maximum value. It can be either horizontal
or vertical. It also has a OnValueChanged UnityEvent to define what it will do when the value is changed.

一个滑块有一个十进制数值,用户可以在一个最小和最大值之间拖动.它可以是横向和纵向.它也有一个OnValueChangedUnity事件以定义当值改变时它将做什么.

See the Slider page for details on using the Slider component.

详情查看”滑块”页面.

Scrollbar

滚动条

A Scrollbar has a decimal number Value between 0 and 1. When the user drags the scrollbar, the value changes accordingly.

一个滚动条有一个十进制数值在0和1之间.当用户拖动滚动条,值相应的改变.

Scrollbars are often used together with a Scroll Rect and a Mask to
create a scroll view. The Scrollbar has a Size value between 0 and 1 that determines how big the handle is as a fraction of the entire scrollbar length. This
is often controlled from another component to indicate how buig a proportion of the content in a scroll view is visible. The Scroll Rect component can automatically do this.

滚动条通常和一个滚动矩形和一个遮罩一起使用以创建一个滚动视图.滚动条有一个大小属性值在0和1之间,确定手柄作为整个滚动条长度一部分的大小.这通常由另一个组件控制以指出多大比例的内容在滚动视图内可见.滚动矩形组件可以自动做此事.

The Scrollbar can be either horizontal or vertical. It also has a OnValueChanged UnityEvent to define what it will do when
the value is changed.

滚动条可以是横向或纵向的.它也有一个OnValueChanged Unity事件以定义当值改变时它将怎么做.

See the Scrollbar page for details on using the Scrollbar component.

查看”滚动条”页面获取使用滚动条组件详情.

Dropdown

下拉菜单

A Dropdown has a list of options to choose from. A text string and optionally an image can be specified for each option, and can be set either in the Inspector or dynamically from code. It has a OnValueChanged UnityEvent
to define what it will do when the currently chosen option is changed.

一个下拉菜单有一系列选项来选择.一个文本字符串和一个可选的图片可被指定到每个选项,且可在检视面板或从代码动态设置.它有一个OnValueChanged Unity事件以定义当当前选项改变时它将怎么做.

See the Dropdown page for details on using the Dropdown component.

查看”下拉菜单”页面获取使用下拉菜单组件详情.

Input Field

输入字段

An Input Field is used to make the text of a Text Element editable by the user. It has a UnityEvent
to define what it will do when the text content is changed, and an another to define what it will do when the user has finished editing it.

一个输入字段用于使一个文本元素的文本可被用户编辑.它有一个Unity事件以定义当文本内容改变时它将如何做,而另一个定义当用户编辑完成时它如何做.

See the Input Field page for details on using the Input Field component.

查看”输入字段”页面获取使用输入字段组件详情.

Scroll Rect (Scroll View)

滚动矩形(滚动视图)

A Scroll Rect can be used when content that takes up a lot of space needs to be displayed in a small area. The Scroll Rect provides functionality to scroll over this content.

一个滚动矩形可用于当内容需要许多空间来在一小块区域显示时.滚动矩形提供功能来在内容上滚动.

Usually a Scroll Rect is combined with a Mask in order to create a scroll view, where only the scrollable
content inside the Scroll Rect is visible. It can also additionally be combined with one or two Scrollbars that can be dragged to scroll
horizontally or vertically.

通常一个滚动矩形是和一个遮罩联合的以便创建一个滚动视图,只有滚动矩形内的可滚动内容可见.它也能额外联合一个或两个滚动条,可横向或纵向被拖拽滚动.

See the Scroll Rect page for details on using the Scroll Rect component.

查看”滚动矩形”页面获取使用滚动矩形组件详情.

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息