Unity说明文档翻译-Editing Properties

Editing Properties

编辑属性

Properties are settings and options for components that can be edited in the inspector.

属性:就是可在检视面板上编辑的组件的设置和选项.

Light component showing various value and reference properties

灯光组件上显示了许多值和引用属性.

 

Properties can be broadly categorized as references (links to other objects and assets) or values (numbers, checkboxes, colors, etc).

属性可广义的分为引用(链接其他对象和资源)和值(数值,复选框,颜色等).

References

引用类型

References can be assigned by dragging and dropping an object or asset of the appropriate type to the property in the inspector. For example, the Mesh Filter component needs to refer to a Mesh asset somewhere in the project. When the component is initially created, the reference is unassigned:

引用可以在检视面板上通过拖拽和放置一个相应类型的对象或资源到属性上来指派.例如:网格过滤器组件需要引用项目内某处的一个网格资源.当组件最初创建时,引用并未指派:

…but you can assign a Mesh to it by dropping a Mesh asset onto it:

但你可以通过拖拽一个网格资源到它上面来指派:

You can also use the Object Picker to select an object for a reference property. If you click the small circle icon to the right of the property in the inspector, you will see a window like this:

你也可以通过对象选择器来遴选一个对象作为引用属性.如果你点击检视面板上属性右边的小圆圈图标,你将看到像这样的一个窗口:

The object picker lets you search for and select objects within the scene or project assets (the information panel at the bottom of the window can be raised and lowered as desired). Choosing an object for the reference property is simply a matter of double clicking it in the picker.

对象选择器让你搜索和选择场景或项目资源上的对象(在窗口底部的信息面板如果需要可以放大和缩小).选择一个对象作为引用属性非常简单,在选择器上双击它即可.

When a reference property is of a component type (such as Transform), you can drop any object onto it; Unity will locate the first component of that type on the object and assign it to the reference. If the object doesn’t have any components of the right type, the assignment will be rejected.

当引用是一个组件类型(如方向组件),你可以拖放任何对象在它上面,Unity将定位对象上第一个此类型的组件并指派它作为引用.如果对象上没有任何相应类型的组件,指派将被拒绝.

Values

值类型

Most values are edited using familiar text boxes, checkboxes and menus, depending on their type (as a convenience, numeric values can also be moved up or down by dragging the mouse over the property name label). However, there are some values of more complex types that have their own specific editors. These are described below.

大部分值类型根据它们的类型使用常用的文本框,复选框和菜单来编辑(为了方便,数值也可以通过在属性名标签上上下拖动鼠标更改).当然,有些更复杂的类型有它们自己的特定编辑器.介绍如下:

Colors

颜色

Color properties will open the Color Picker when clicked.

当点击颜色属性将打开颜色选择器.

The Color Picker window

颜色选择器窗口

The HDR Color Picker window (displayed when clicking the emission color property in the standard shader or if you use the ColorUsageAttribute on a Color in your script)

HDR[高动态范围图像(High-Dynamic Range]颜色选择器窗口(当你在标准着色器或在使用了Color类的ColorUsageAttribute属性的脚本上点击颜色属性时将弹出显示).

The HDR Color Picker window shown with the tonemapped option selected

HDR颜色选择器窗口显示了色调映射选择.

 

Unity uses its own color picker but on Mac OS X you can choose to use the system picker from the Preferences (menu: Unity > Preferences and then Use OS X Color Picker from the General panel).

Unity使用它自己的颜色选择器,但在Mac OS X系统上你可以通过首选项选择使用系统的颜色选择器(菜单:Unity>首选项然后通过通用面板选用OS X 颜色选择器).

Gradients

渐变

In graphics and  animation, it is often useful to be able to blend one colour gradually into another, over space or time. A gradient is a visual representation of a colour progression, which simply shows the main colours (which are called stops) and all the intermediate shades between them:

在图形和动画中,在时间或空间上融合一种颜色渐变到另一种通常很有用.渐变是颜色累进的视觉呈现,简单的显示了主颜色(称为站点)和所以它们间的中间色调渐变:

 

The upward-pointing arrows along the bottom of the gradient bar denote the stops. You can select a stop by clicking on it; its value will be shown in the Color box which will open the standard colour picker when clicked. A new stop can be created by clicking just underneath the gradient bar. The position of any of the stops can be changed simply by clicking and dragging and a stop can be removed with ctrl/cmd + delete.

顺着渐变条底部的上指箭头表示站点.你可以通过点击它选定一个站点.它的值将显示在颜色框内,当点击颜色框时将打开标准颜色选择器.可以通过点击渐变条底部新建一个站点.站点的位置可以通过点击拖拽来改变并且可以用ctrl/cmd+delete键删除它们.

The downward-pointing arrows above the gradient bar are also stops but they correspond to the alpha (transparency) of the gradient at that point. By default, there are two stops set to 100% alpha (ie, fully opaque) but any number of stops can be added and edited in much the same way as the colour stops.

渐变条上边的下指箭头也是站点但它们相当于渐变在此点的alpha(透明度).默认,有两个设置为100% alpha(即完全不透明)的站点但可以像颜色站点一样添加和编辑任意数量的站点.

Curves

曲线

A Curve is a line graph that shows the response (on the Y axis) to the varying value of an input (on the X axis).

一条曲线是一个线状图表用于显示对一个输入值变化(在x轴)的响应(在y轴).

Curve editor

曲线编辑器

 

Curves are used in a variety of different contexts within Unity, especially in animation, and have a number of different options and tools. These are explained on the Editing Curvespage of the manual.

曲线被用于Unity各种不同方面,特别是在动画上,它有许多不同选项和工具.这些在手册的”编辑曲线”页面上有介绍.

Arrays

数组

When a script exposes an array as a public variable, the inspector will show a value editor that lets you edit both the size of the array and the values or references within it.

当一个脚本以公共变量公开一个数组,检视面板将显示值编辑器,让你编辑数组的大小和它包含值和引用变量.

Script with a Vector3 array property

一个包含一个三维数组属性的脚本.

 

When you decrease the Size property, values from the end of the array will be removed. When you increase the size, the current last value will be copied into all the new elements added. This can be useful when setting up an array whose values are mostly the same - you can set the first element and then change the size to copy it to all the other elements.

当你降低数组大小,数组最后的值将被删除.当你增加大小,当前最后的值将被拷贝到所以新添加的元素上.这对设置一个值大部分相同的数组非常有用-你可以设置第一个元素然后改变数组大小来拷贝它到所有其他元素上.

Editing Several Objects at Once

一次编辑多个对象

When you have two or more objects selected, the components they have in common can all be edited together (ie, the values you supply will be copied to all the selected objects).

当你选中两个以上对象时,它们通用的组件都可在一起编辑(即,你提供的值将会拷贝到所有选中对象上).

 

Inspector showing a multiple selection

检视面板上显示了一个多选择

 

Where property values are the same for all selected objects, the value will be shown but otherwise, it will be shown as a dash character. Only components that are common to all objects will be visible in the inspector. If any selected object has components that are not present on other objects, the inspector will show a message to say that some components are hidden. The context menu for a property (opened by right-clicking on its name label) also has options to allow you to set its value from any of the selected components.

当所选对象的属性值都相同时,它们的值才会显示,否则显示为破折号.只有所有对象的通用组件才会显示在检视面板上.如果任何所选对象有不出现在其他对象上的组件,检视面板将显示一条消息告诉你一些组件被隐藏了.属性的右键菜单(通过右键点击它的名称标签打开)有选项允许你通过任何选定组件来设置它的值.

Note that you can also edit several selected instances of a prefab at once but the usual Select,Revert and Apply buttons will not be available.

注意,你也可以一次编辑几个来自一个预设物体的选定实例但通常,选择,重置和同意按钮将不可用.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值