专属 Inspector 是专门用于特定游戏对象、Unity 组件或资源的 Inspector 窗口。它始终显示为其打开的项目的属性,即使您在场景或项目中选择了其他内容。
专属 Inspector 的工作方式与常规 Inspector 一样,但有以下不同:
您可以根据需要打开任意数量的专属 Inspector。专属 Inspector 在一个浮动窗口中打开,您可以重新定位、停靠和调整大小,和其他任何窗口的方式一样。
当您关闭项目时,Unity 会保存所有打开的专属 Inspector,并在您重新打开项目时恢复。
有多种方法可以打开专属 Inspector,具体取决于您要检查的内容。
Unity 将专属 Inspector 添加到打开的窗口列表中(菜单:Window > Panels > [打开的窗口列表])。
从列表中选择一个专属 Inspector 以将其置于最前面。
要为单个游戏对象或资源打开一个专属 Inspector:
或者,选择游戏对象或资源并执行以下操作之一:
Unity 在新窗口中打开专属 Inspector。
要打开多个游戏对象/或资源的专属 Inspector:
Unity 会打开一个新窗口,其中包含每个选定项目的专属 Inspector 选项卡。
下图显示了三个选定的项目(左):两个游戏对象和一个资源,以及为它们打开专属 Inspector 时的窗口(右)。
要为游戏对象的组件之一打开一个专属 Inspector:
这对于经常编辑的属性很有用。例如,您可能需要频繁移动游戏对象,但保持其余属性不变。在这种情况下,您可以打开其 Transform 组件。
下图显示了在常规 Inspector (1) 中打开的摄像机,以及在专属 Inspector (2) 中打开的变换组件。请注意,专属 Inspector 的选项卡标题显示了该组件所属的游戏对象的名称。
当游戏对象具有引用属性时,您可以为它们引用的游戏对象或资源打开专属 Inspector。
您可以设置打开专属 Inspector 的快捷方式,用于将指针悬停在 Hierarchy 视图或 Project 视图中的任何项目。
要将键盘快捷键分配给 PropertyEditor > OpenMouseOver 命令,请使用 Shortcuts Manager。
当您想要打开一个项目的专属 Inspector 而不影响当前选择时,这很有用。
要定位专属 Inspector 中显示的属性所属的项目,请执行以下操作之一:
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.