Как открыть inspector в unity

Using the Inspector (Использование панели Inspector)

Inspecting Game Objects

Панель Inspector используется для того, чтобы просматривать и редактировать Свойства объектов различными способами.

When you select a GameObject in the Hierarchy or Scene View, the Inspector will show the Properties of all Components and Materials on that object and allow you to edit them. The image above shows the inspector with the default 3D camera GameObject selected. In addition to the object’s position, rotation and scale values, all the properties of the camera are available to edit.

Inspecting Script Variables

When Game Objects have custom Script components attached, the public variables of that script are also shown in the inspector and can be viewed and edited like the properties of Unity’s built-in components. This allows you to set parameters and default values in your scripts easily without modifying the code.

Inspecting Assets

When an Asset is selected in your Project Window, the Inspector will show you the settings related to how that asset is imported and used at runtime. Each type of asset will have a different arrangement of settings. Below are some examples of the inspector showing the import settings for other asset types:

Как открыть inspector в unityInspector отображает геймобъекта c компонентами Как открыть inspector в unityInspector отображает геймобъекта c компонентами Как открыть inspector в unityInspector отображает геймобъекта c компонентами

Project Settings

Источник

The Inspector window

Projects in the Unity Editor are made up of multiple GameObjects that contain scripts, sounds, Meshes, and other graphical elements such as Lights. The Inspector window (sometimes referred to as “the Inspector”) displays detailed information about the currently selected GameObject, including all attached components and their properties, and allows you to modify the functionality of GameObjects in your Scene.

Как открыть inspector в unityThe Inspector in its default position in Unity

Inspecting GameObjects

Use the Inspector to view and edit the properties and settings of almost everything in the Unity Editor, including physical game items such as GameObjects, Assets, and Materials, as well as in-Editor settings and preferences.

Как открыть inspector в unityThe Inspector window displaying settings for a typical GameObject and its components

When you select a GameObject in either the Hierarchy or Scene view, the Inspector shows the properties of all components and Materials of that GameObject. Use the Inspector to edit the settings of these components and Materials.

The image above shows the Inspector with the Main Camera GameObject selected. In addition to the GameObject’s Position, Rotation, and Scale values, all the properties of the Main Camera are available to edit.

Inspecting script variables

When GameObjects have custom script components attached, the Inspector displays the public variables of that script. You can edit these variables as settings in the same way you can edit the settings of the Editor’s built-in components. This means that you can set parameters and default values in your scripts easily without modifying the code.

Inspecting Assets

When an Asset is selected in your Project window, the Inspector shows you the settings related to how that Asset is imported and used at run time (when your game is running either in the Editor or your published build).

Each type of Asset has a different selection of settings. The images below demonstrate some examples of the Inspector displaying the import settings for other Asset types:

Как открыть inspector в unityThe Inspector window displaying the import settings for an Audio file

Как открыть inspector в unityThe Inspector window displaying the Import Settings for a Texture

Prefabs

If you have a Prefab selected, some additional options are available in the Inspector window.

For more information, see documentation on Prefabs.

Project settings

When you select any of the Project Settings categories (menu: Editor > Project Settings), these settings are displayed in the Inspector window. For more information, see documentation on Project Settings.

Icons and labels

You can assign custom icons to GameObjects and scripts. These display in the Scene view along with built-in icons for GameObjects such as Lights and Cameras.

For more about icons and labels, see Unity documentation on assigning icons.

Re-ordering components

To reorder components in the Inspector window, drag-and-drop their headers from one position to another. When you drag a component header, a blue insertion marker appears. This shows you where the component should go when you drop the header:

Как открыть inspector в unityDragging and dropping components on a GameObject in the Inspector window

You can only reorder components on a GameObject. You can’t move components between different GameObjects.

You can also drag and drop script Assets directly into the position you want them to appear.

When you select multiple GameObjects, the Inspector displays all of the components that the selected GameObjects have in common. To reorder all of these common components at once, multi-select the GameObjects, then drag-and-drop the components into a new position in the Inspector.

The order you give to components in the Inspector window is the order you need to use when querying components in your user scripts. If you query the components programmatically, you’ll get the order you see in the Inspector.

2018–04–23 Page amended with limited editorial review

Источник

The Inspector window

Как открыть inspector в unityThe Inspector window docked in the Unity Editor

Opening an Inspector window

To open an Inspector window, do one of the following:

You can open as many Inspector windows as you want, and reposition, dock, and resize them in the same way you can any other window.

Controlling Inspector window focus

By default, an Inspector window displays properties for the current selection. The contents of the Inspector change whenever the selection changes. To keep the same set of properties open, regardless of the current selection, do one of the following:

Inspecting items

What you can see and edit in an Inspector window depends on what you select. This section describes what an Inspector window displays for different types of items you can select.

Inspecting GameObjects

When you select a GameObject (for example, in the Hierarchy or Scene view An interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary ), the Inspector displays the properties of all of its components and Materials. You can edit the properties, and reorder the components in the Inspector window.

Inspecting custom script components

When GameObjects have custom script components attached, the Inspector displays the scripts A piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary ’ public variables. You can edit script variables in the same way as you edit any other properties, which means that you can set parameters and default values in your scripts without modifying the code.

Inspecting Assets

When you select an Asset Any media or data that can be used in your game or project. An asset may come from a file created outside of Unity, such as a 3D Model, an audio file or an image. You can also create some asset types in Unity, such as an Animator Controller, an Audio Mixer or a Render Texture. More info
See in Glossary (for example, from the Project window A window that shows the contents of your Assets folder (Project tab) More info
See in Glossary ), the Inspector displays settings that control how Unity imports and uses the Asset at runtime.

Each type of Asset has its own settings. Examples of Asset import settings that you edit in an Inspector window include the:

Inspecting settings and preferences

When you open the Project Settings A broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your project behave. More info
See in Glossary (menu: Editor > Project Settings), Unity displays them in an Inspector window.

Inspecting Prefabs

When you work with Prefabs, the Inspector window displays some additional information and provides some additional options. For example:

For more information about working with Prefabs in the Inspector window, see the Prefabs An asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary section.

Inspecting multiple Items

When you have two or more items selected, you can edit all of the properties they have in common in an Inspector window. Unity copies the values you supply to all the selected items. The Inspector window displays a count of the number of selected items.

Multiple GameObjects

When you select multiple GameObjects, the Inspector window displays all of the components they have in common.

Multiple Assets

When you select multiple Assets of the same type, the Inspector window displays all of the properties they have in common.

When you select multiple Assets of different types, the Inspector displays a list that shows how many of each type of Asset are selected. Click any item in the list to Inspect all Assets of that type.

Как открыть inspector в unityInspector showing multiple selected Assets of different types

Multiple Prefabs

You can inspect multiple selected instances of a Prefab in the same way as you edit multiple GameObjects, but the Inspector hides the Select, Revert, and Apply buttons (see Editing a Prefab via its instances).

Locating an Inspector window’s source

When you open a GameObject or Asset in an Inspector window, you can locate it in the Scene A Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary view or Project View using the Ping command.

From the Inspector window’s More Items () menu, select Ping. Unity highlights the item in the Hierarchy view or the Project view.

Источник

Настройки инспектора

Блокировка

Обычно инспектор отображает детали текущего выбранного объекта, но иногда бывает полезным, чтобы в инспекторе отображался один объект, пока вы работаете с другими. Чтобы так сделать, у инспектора есть режим блокировки (Lock), который вы можете активировать при помощи маленькой иконки замка в верхнем правом угле окна инспектора.

Учтите, что у вас может быть открыт больше чем 1 инспектор одновременно (выбрать из меню инспектора Add Tab ), таким образом вы можете иметь и заблокированного инспектора и дополнительного, для работы с выбранным объектом.

Как открыть inspector в unityAdding a new tab, docking it under the current inspector tab, and locking it.

Режимы Нормальный/Отладка

Другая опция в меню, это выбор между режимом Normal(нормальный) и Debug(отладка) Обычно, инспектор отображает пользовательский редактор для ассета или компонента, если есть доступный, но иногда удобнее напрямую видеть параметры. Режим отладки отображает только параметры, в отличие от пользовательского редактора, а для скриптов он также отображает и private переменные (хотя их значения не могут быть изменены так, как public переменные).

Как открыть inspector в unityСкрипт отображаемый в режиме отладки с затемнёнными private переменными

Как и режим блокировки, режим Нормальный/Отладка применяется индивидуально для каждого инспектора, таким образом у вас может быть открыто 2 инспектора одновременно так, чтобы видеть оба окна.

Источник

The Inspector window

Как открыть inspector в unityThe Inspector window docked in the Unity Editor

Opening an Inspector window

To open an Inspector window, do one of the following:

You can open as many Inspector windows as you want, and reposition, dock, and resize them in the same way you can any other window.

Controlling Inspector window focus

By default, an Inspector window displays properties for the current selection. The contents of the Inspector change whenever the selection changes. To keep the same set of properties open, regardless of the current selection, do one of the following:

Inspecting items

What you can see and edit in an Inspector window depends on what you select. This section describes what an Inspector window displays for different types of items you can select.

Inspecting GameObjects

When you select a GameObject (for example, in the Hierarchy or Scene view An interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary ), the Inspector displays the properties of all of its components and Materials. You can edit the properties, and reorder the components in the Inspector window.

Inspecting custom script components

When GameObjects have custom script components attached, the Inspector displays the scripts A piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary ’ public variables. You can edit script variables in the same way as you edit any other properties, which means that you can set parameters and default values in your scripts without modifying the code.

Inspecting Assets

When you select an Asset Any media or data that can be used in your game or project. An asset may come from a file created outside of Unity, such as a 3D Model, an audio file or an image. You can also create some asset types in Unity, such as an Animator Controller, an Audio Mixer or a Render Texture. More info
See in Glossary (for example, from the Project window A window that shows the contents of your Assets folder (Project tab) More info
See in Glossary ), the Inspector displays settings that control how Unity imports and uses the Asset at runtime.

Each type of Asset has its own settings. Examples of Asset import settings that you edit in an Inspector window include the:

Inspecting settings and preferences

When you open the Project Settings A broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your project behave. More info
See in Glossary (menu: Editor > Project Settings), Unity displays them in an Inspector window.

Inspecting Prefabs

When you work with Prefabs, the Inspector window displays some additional information and provides some additional options. For example:

For more information about working with Prefabs in the Inspector window, see the Prefabs An asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary section.

Inspecting multiple Items

When you have two or more items selected, you can edit all of the properties they have in common in an Inspector window. Unity copies the values you supply to all the selected items. The Inspector window displays a count of the number of selected items.

Multiple GameObjects

When you select multiple GameObjects, the Inspector window displays all of the components they have in common.

Multiple Assets

When you select multiple Assets of the same type, the Inspector window displays all of the properties they have in common.

When you select multiple Assets of different types, the Inspector displays a list that shows how many of each type of Asset are selected. Click any item in the list to Inspect all Assets of that type.

Как открыть inspector в unityInspector showing multiple selected Assets of different types

Multiple Prefabs

You can inspect multiple selected instances of a Prefab in the same way as you edit multiple GameObjects, but the Inspector hides the Select, Revert, and Apply buttons (see Editing a Prefab via its instances).

Locating an Inspector window’s source

When you open a GameObject or Asset in an Inspector window, you can locate it in the Scene A Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary view or Project View using the Ping command.

From the Inspector window’s More Items () menu, select Ping. Unity highlights the item in the Hierarchy view or the Project view.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *