【更新】Component Names 1.0.9
本帖最后由 微笑的猫 于 2024-7-10 15:00 编辑Component Names 系列索引:
Component Names 1.0.7下载链接
Component Names 1.0.8下载链接
Component Names 1.1.0下载链接
Ever had trouble distinguishing multiple colliders on the same GameObject from each other?
Ever wished you could rename that generic "Event Trigger" component to something a little more descriptive like "On Click Open Settings"?
What if you could attach little notes to your components to provide some clarifying context?
Wouldn't it be great if you could see the current state of that "Health" component right in the title without having to unfold it?
Now you can!
Component Names integrates seamlessly with the Inspector and makes it possible to rename components at will as if it was a native feature.
Features
Select a component's header and press F2 to start renaming it (or select "Rename" from the context menu if your keyboard is broken).
Default name is shown in parentheses after the custom name by default.
Custom component names can be seen in Object fields.
Custom component names can be seen in UnityEvent dropdowns.
See a summary description of components when mouseovering their header.
Give custom tooltips to components.
All custom name data is fully stripped from builds.
Features For Coders
Get component names in code using Component.GetName (great for debugging!).
Generate component names from their current state by calling Component.SetName in OnValidate.
Make Component.name and Component.ToString return custom component names by deriving from custom base class.
Highly Compatible
Compatible with Power Inspector, Odin Inspector and any custom editors you might have.
你是否曾为区分同一游戏对象上的多个碰撞器而烦恼?
你是否曾希望你能把那个通用的 "事件触发器 "组件改名为更有描述性的东西,比如 "点击打开设置"?
如果你能在你的组件上附加一些小注释,以提供一些明确的上下文,会怎么样?
如果你能在标题中看到 "健康 "组件的当前状态,而不必展开它,那不是很好吗?
现在你可以了!
组件名称与检查器无缝集成,使得随意重命名组件成为可能,就像它是一个本地功能一样。
功能
选择一个组件的标题,然后按F2开始重命名它(如果你的键盘坏了,可以从上下文菜单中选择 "重命名")。
默认情况下,默认名称显示在自定义名称后面的括号里。
自定义组件的名称可以在对象字段中看到。
自定义组件名称可以在UnityEvent下拉框中看到。
当鼠标移到组件的头顶时,可以看到组件的摘要描述。
给予组件自定义的工具提示。
所有的自定义名称数据都从构建中完全剥离。
为编程人员提供的功能
使用Component.GetName获取代码中的组件名称(非常适合调试!)。
通过在OnValidate中调用Component.SetName从其当前状态生成组件名称。
通过派生自定义基类,使Component.name和Component.ToString返回自定义组件名称。
高度兼容
与Power Inspector、Odin Inspector和你可能拥有的任何自定义编辑器兼容。
页:
[1]