unity3d 使用检视视图 Using the Inspector

orientalfashion 发布于 2013/08/30 10:52
阅读 420
收藏 0
The Inspector is used to view and edit Properties of many different types.


Games in Unity are made up of multiple GameObjects that contain meshes, scripts, sounds, or other graphical elements like Lights. When you select a GameObject in the Hierarchy or Scene View, the Inspector will show and let you modify the Properties of that GameObject and all the Components and Materials on it. The same will happen if you select a Prefab in the Project View. This way you modify the functionality of GameObjects in your game. You can read more about the GameObject-Component relationship, as it is very important to understand.

Unity的游戏都是由包含网格、脚本、声音或其他图形元素(比如光源)的多个游戏对象所构成。当你在层次视图或场景视图中选择一个游戏对象,检视面板会显示它并且可以让你修改游戏对象的属性和所有组件及材质。当你在项目视图中选择一个预设件,也同样可以这样,用这种方法你可以修改游戏对象的功能。你可以阅读GameObject-Component relationship,因为它是非常重要的。

Inspector shows the properties of a GameObject and the Components and Materials on it.

When you create a script yourself, which works as a custom Component type, the member variables of that script are also exposed as Properties that can be edited directly in the Inspector when that script component has been added to a GameObject. This way script variables can be changed without modifying the script itself.http://www.unitymanual.com

当你创建一个 unity3d脚本,它将作为一个自定义的组件类型,当这个脚本组件被添加到一个游戏对象中时,该脚本的成员变量将作为可直接编辑的属性陈列在检视面板中。这样以来无需修改脚本本身就可以直接改变其变量。

Furthermore, the Inspector is used for showing import options of assets such as textures, 3D models, and fonts when selected. Some scene and project-wide settings are also viewed in the Inspector, such as all the Settings Managers.


Any property that is displayed in the Inspector can be directly modified. There are two main types of Properties: Values and References.