Oh man, this has been on my “please add this to unity” wish list since the 4.x days.
Any chance this feature will get added to PowerInspector? I’m looking the features over there, and I think I’d want to go all in with PowerInspector on my project, but I’d hate to miss out on this feature.
I’ve been mulling over this functionality since 2019 (after I stumbled upon [this thread]( Please add a renamer feature to components! page-2)). I’ve tried out a couple of different approaches to solving this over the years, but never was able to put together anything up to a standard I was satisfied with - until I finally had a Eureka moment more recently and this is the end result
I don’t have any plans to add built-in component renaming functionality to Power Inspector, however Component Names is fully compatible with Power Inspector as well.
If I change Inspector to Debug mode, and change the script of a component with its extended class which has different name. Then the header name could not refresh correctly.
If I press F2 and delete all string and press enter to clear the name, the old name are still there.
and the string in the rename input editor will become “Melee1 <color=grey>(Melee Weapon)” next time. In this specific case, the real name of new script is “PP Melee Weapon”
I think we should have a “Clear all meta data of Component Names” option in the context menu.
Hey @JustusPan thanks for letting me know about this. I’ll investigate how to fix these issues that happen if an attached component’s type is swapped to a different in debug mode.
All existing component name meta data should get cleared when you give a component a blank name, just like you tried, but in this case things don’t seem to be working as they should after the type change. If it’s possible, removing the component, and re-adding it should cause all the corrupted metadata to get cleared. But I’ll investigate on my side how to resolve situations like this automatically.
I’ll check the asset in Unity 2021.3 and starting working on a fix. Thanks for letting me know!
If you want to remove Component Names from a project you can use the uninstall tool I’ve attached below to clean up your scenes from any leftover empty name containers.
@trueh I managed to track down what was causing the issue and have now a fix for it. I’ll submit the fix to the asset store for review today, and it’ll probably become available for download early next week.
If you’d like to get your hands on the fixed version before that just drop me a PM and I can send it your way.
Hey, @SisusCo really liking the plugin so far. I was wondering though, would it be at all possible to have the custom names also show up when the component is being referenced as a parameter in a UnityEvent ?
Example:
The method being called in this instance is
public void PrintComponentName(NamedComponent component)
{
Debug.Log(component.GetName());
}
this issue seems will also affect the base prefab, the deleated component in variant prefab also eliminate the names in the base prefab. And I could not assign names in base prefab anymore.
This reveal some issues under nested prefab workflow.
Could you please look into this problem? @SisusCo
These warning will happen each time I open unity now. Is there anyway to delete all meta data created by this plugin and remove ComponentName plugin safely?
Another Bug: In following two situations, you will see different names of same component of a same prefab( this prefab is a prefab variant of a base prefab)
single click prefab in Project window, then inspector will show the components of that prefab
double click prefab in Project window, then inspector will show the components of that prefab
Hey @JustusPan , thank you for letting me know about all these findings with prefab variants! I’ll investigate how to fix them.
This tool can be used to remove all component name metadata from the all open scenes or selected objects. It can be used both before or after Component Names has been uninstalled.