"Unity" 2.7 viewer (Inspector)

Source: Internet
Author: User

Categories: Unity, C #, VS2015

Date Created: 2016-03-31 I. INTRODUCTION

Games in unity consist of multiple game objects (gameobjects) that contain other graphical elements such as grids, scripts, sounds, or lights (Lights). The viewer (Inspector) displays details of the currently selected game object (gameobjects), including all add-ons (components) and their attributes.

The Inspector view is used to display details about the object currently selected in the game scene, as well as the overall properties of the game, including the object name, label, position coordinates, rotation angle, zoom, component, and so on.

In the Inspector view, each component has a corresponding Help button and context menu:

Clicking the Help button (question mark icon) displays the documentation related to the component in the user manual that is installed to the computer.

Clicking the context menu (pinion icon) displays the options associated with the component, or you can select the Reset command from the drop-down menu to reset the property value to the default value.

    • Transform: The user can modify the position, rotation, and scaling properties of an object through the Transform component.
    • Mesh Filter: A mesh filter that gets the grid information (mesh) from the object and passes it to the grid renderer.
    • Box Collider: Cube Collider, in order to prevent the object from penetrating, you need to add a collision body to the objects. The distance is calculated based on the coordinates of the object, and then the collision is judged.
    • Mesh Renderer: The grid renderer obtains the geometry from the mesh filter and renders it based on the defined position of the transform component of the game object.
    • Cast Shadow: Whether the mesh casts shadows.
    • Receive Shadows: Whether the grid receives shadows.
    • Materials: Sets the material of the object.

When you create a script, it acts as a custom component (Component) type, and when the script component is added to a game object (Gameobject), the member variable of the script is displayed as a directly editable property (properties) in the viewer ( Inspector). In this way, you can change the variables without modifying the script itself.

In addition, the viewer (Inspector) is also used to display import options for resources such as textures, three-dimensional models, and font selection. Certain scene and project scope settings can also be viewed in the viewer (Inspector), such as all settings managers (Settings Managers).

Any properties displayed in the viewer (Inspector) can be modified directly. There are two main types of attributes: Values and references (References). The value may be the color or vector of the light source. A reference is a link to another object, such as a texture or other game object.

1. Edit Value Properties

The Value property cannot reference anything and can be edited directly. Typical value attributes are numbers, switches, strings, and selection pop-ups, which can also be colors, vectors, curves, and other types.

The Value property on the viewer can be a number, a check box, a string ...

Many value attributes have a text field and can be easily adjusted by clicking on them, typing a value using the keyboard, and then pressing Enter to save the value.

You can also put your mouse next to the numeric properties and drag to scroll the values quickly

Some numeric properties have a slider that you can use to visually adjust the value.

Some value properties pop up a small dialog box that you can use to edit values.

(1) Color picker

Properties of the color type will open the color selector (picker). To find a value, simply place the mouse over the color you want to grab, and then use the Eyedropper tool (Eyedropper tools). The \ RGB/HSV Selector lets you convert the values of red, green, and blue to the hue, saturation, and value (intensity) of the color.

Finally, the alpha channel value allows you to control the transparency of the selected color.

(2) Curve editor (Curve editor)

The properties of the animation curve (Animationcurve) type Open the Curve editor (Curve editor). The Curve editor (Curve Editor) allows you to edit curves or select a preset.

Because of the old version, the type is called an animation curve (Animationcurve), but it can be used to define any custom curve functionality. This feature can be evaluated when the script is run. The animation curve (Animationcurve) property appears as a small preview in the viewer:

Click on it to open the Curve editor (Curve editor):

The Curve editor (Curve editor) is used to edit animation curves (animationcurves).

The cyclic mode (wrapping mode) allows you to select the Ping Pong, Clamp, and loop control keys in the curve.

Presets (presets) let you modify the curve to the default profile it can have.

(3) Gradient editor

In graphics and animations, the ability to blend a color into another color from space or time is a very useful feature. Gradients are visual representations of color changes, showing only the primary colors (known as the start and end colors) and all the critical tones between them. In Unity, the gradient has its own special value editor, as shown below.

The top arrow along the bottom of the gradient bar indicates the starting and ending color. Click to select a starting and ending color, its value will be displayed in the color box, and the color box will open the standard color selector when clicked. Click below the gradient bar to create a new starting and ending color. Click and drag to change the position of any start and end color, and press Ctrl/cmd + DELETE to remove a starting and ending color.

The arrows above the gradient bar are also the starting and ending colors, but they correspond to the alpha (transparency) of the point gradient. By default, there are two starting and ending colors set to 100% alpha (that is, completely opaque), but any number of start and end colors are added and edited in much the same way as the start and end points of the color.

(4) array

The script you write can arrange the original. Net Array in the viewer (Inspector). When the viewer (Inspector) encounters an array, it lets you edit the length of the array. The default length is zero. When the size is set to greater than zero, the viewer (Inspector) creates slots where you can enter values for the array elements. If the array stores data of the Unity-known type, it will insert the appropriate value editor. For example:

var pickupcolors:color32[];

A color picker editor is generated for each element in the array.

2. Specify references

A reference property is a property that can reference other objects, such as game Objects (gameobjects), components, or resources (Assets). The reference slot displays the type of object that can be used for the reference. For example, an audio clip property slot shows an audio clip class object that it can reference:

An audio clip file is now referenced in the audio clip properties.

Class references are very fast and powerful, especially when using scripts.

(1) Drag and drop

You can assign an object to a reference property by dragging or dropping it, or by using the Object Picker (picker).

You can do drag and drop by selecting the desired object in Scene view, hierarchy View (Hierarchy), or Project view, and then dragging it to the reference property slot.

If a reference property accepts a special type of component (Component) (such as a transform component (Transform)), then dragging the game object (Gameobject) or preset (Prefab) to the Reference property works well, if the game object ( Gameobject) or presets (Prefab) contain the correct type of components. Although this is a game object (Gameobject) or preset (Prefab) that you dragged over, the property will still reference this component.

If you drag an object onto a reference property, and the object is of the wrong type or does not contain the correct component, you will not be able to specify the object for the reference property.

(2) Object Picker

You can click the Small target icon next to the reference slot to open the Object Picker (picker).

Object Picker is a simple window that lets you assign these objects in the viewer after previewing and searching for available objects.

Although object picker is easy to use, you should also be aware of the following caveats. is the interface description for Object Picker (Picker):

    • Search: When there are many objects in the picker, you can use the search field to filter. The search field can also search for objects using tags.
    • View selector: Toggles the search library for objects in scenes and resources.
    • Preview Size: This horizontal scroll bar lets you increase/decrease the size of the preview object in the preview window. With this scroll bar, you can see more or fewer objects at any time in the preview window.
    • Preview window: Here are all the objects in the scene/Resources folder that the search field filters out.
    • Object information: Displays information about the currently selected object. The content of the field depends on the type of object you are viewing, for example, if you select a grid, it tells you how many vertices and triangles are, whether there are Uvs, and whether there is a skin. However, if you select an audio file, it will provide you with information such as bitrate, length, and so on.
    • Object preview: This also depends on the type of object you are viewing. If you select a grid, it will show you the appearance of the grid, but if you select a script file, it will only display the file's icon.

Object Picker can work on any resource in the project, which can be a video, song, terrain, GUI skin, script file, or grid, which is a tool you will use frequently.

Tip: Using labels on resources (Assets) makes it easier to find them than using the Object Picker (picker) search field.

If you do not want to see the description of the object, you can drag down the middle slider at the bottom of the preview window.

If you want to see a detailed preview of the object, you can zoom in on the object preview by dragging the middle slider at the bottom of the preview window.

3. Multi-object editing

You can select and edit multiple objects of the same type at the same time in the viewer (Inspector). Any changed properties are applied to all the selected objects. This can save a lot of time if you want to make the same changes to many objects.

When you select multiple objects, only the components that exist in all the selected objects appear in the viewer (Inspector). If the component only exists in some selected objects, a small hint appears at the bottom of the viewer (Inspector) stating that the components that exist only in the selected object cannot be multi-edited.

(1) Attribute value

When multiple objects are selected, each property displayed in the View (Inspector) represents the properties of each selected object. If the property values on all objects are the same, the value will be displayed as if you were editing a single object. If the values of the properties on all the selected objects are not the same, no values are displayed, and dashes or similar symbols are displayed, indicating that the values are different.

(2) Multiple edits of two objects

Whether it is a display value or a dash, the property value can be edited as usual, and the modified value is applied to all selected objects. If the values are different and the dashes are displayed, you can still right-click the Properties tab. This pops up a menu so that you can choose which object to inherit the property value from.

(3) Multiple edit presets or model instances

Like game Objects, presets can be edited in the scene in multiple edits. Instances of presets or models can also be multi-edited; However, there are limitations: when you edit a single preset or model instance, any properties that differ from the preset or model are displayed in bold, and right-click will have an option to revert the property to its own value in the preset or model. In addition, the game object has options to apply or restore all changes. These operations are not available when you are editing multiple objects. The property cannot be restored or applied, and is not displayed in bold, even if it is not the same as the preset or model. It is important to remind you that the viewer (Inspector) will tell you that the instance management is not valid, while the Choose (select), Restore (Revert), and apply buttons will usually appear.

Invalid instance management for preset multi-edits

(4) Unsupported objects

A few object types do not support multi-object editing. When you select multiple objects at the same time, these objects will display a prompt telling you that multi-object editing is not supported.

This message is also displayed when editing one of your own scripts using the custom editor, if it does not support multi-object editing. See the Scripting reference for editor classes to learn how to implement support for multi-object editing in your own custom editor. Second, viewer options

"Viewer lock" and "Viewer debug mode" are two useful options that can help you in the workflow.

1. Lock

Lock allows you to keep focus on specific game objects (Gameobject) in the viewer (Inspector) when you select Other game objects (gameobjects). To toggle the lock option on the viewer (Inspector), click the lock/Unlock () icon on the viewer (Inspector), or open the tab menu and select Lock.

Lock the Viewer (Inspector) from the tab menu.

Note that you can open more than one viewer (Inspector) at the same time, and you can lock the viewer for a particular game object while keeping the other unlocked to show which game object is selected (Gameobject).

2. Commissioning

Debug mode allows you to examine the private variables of the component in the viewer (Inspector), which are not normally displayed. To change to debug mode, open the Tab menu and select Debug.

Under Debug mode, all components are displayed using the default interface, rather than using a custom interface that some components use in normal mode. For example, the transform (Transform) component displays the rotated four-dollar value (quaternion values) in debug mode (debug modes) instead of the Euler angle (Euler angles) shown under normal mode. You can also use debug mode to check the value of a private variable in your own Script component.

Debug mode in the viewer (Inspector) allows you to examine private variables in scripts and other components.

Each viewer (Inspector) has debug mode, and you can have one viewer (Inspector) work in debug mode (debug modes) while another does not work.

"Unity" 2.7 viewer (Inspector)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.