-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Search for direct references only #42
Comments
With the current implementation, I believe you can right click the scene, select "Expand Direct References Only" and then ignore the lines that don't have a green tint to their left (green tint indicates that the object resides in the scene). If you wish, you could then select the non-green lines and remove them via Delete. video.mp4 |
Thank you for the quick response! I didn't know "Expand Direct References Only" and "Expand Main References Only" exist. However, in all cases I tested they collapsed all search results without exceptions and all objects have a green tint on it. |
For "scene object->prefab->searched reference" chains, prefab shouldn't be tinted green (inside scene search results). I'm surprised TBH. |
For that setup as well: All search results are tinted green. |
Could you create a small repro case so that I can investigate it further? |
Here on that branch I created a reproduction setup to showcase it: https://github.com/detzt/BugReporting/tree/bugs/direct-references When you search for references of the Blue or Green material, I with to distinguish between direct references in the scene (the quad objects that have "in scene" in their name) and indirect references (the cubes that are simply named "Model"). Besides the names that are explicitly set for this example, the entries in the search results are indistinguishable. I hope this illustrates the issue I'm having. |
I see what you mean. I'll experiment on it. |
Thank you :) |
I've added "Hide non-overridden prefab variables in scenes" option to achieve this. In the future, I'm planning to experiment on a similar filtering for when a C# script's or prefab's usages are searched. |
It works flawlessly, thank you! |
I've added support for C# script and prefab usages. Before releasing it, I'm trying to make sure that it has a good user experience. This new feature means that:
Tooltips: The new warning: What do you think about this change? Feel free to express your concerns or suggest modifications. |
Looks good to me in general 👍🏼 When any overrides are present on objects that would otherwise be hidden, they are still showing up in the search results, right? E.g. in the second tooltip scenario, if Healthbar.maxHealth would be overridden in one of the scene instances, that scene instance would not get hidden? When Prefab A is nested in Prefab B and I search for A, it shows its occurrence in B and any direct instances of A in any scenes, but instances of B are hidden, correct? Good idea to display information about the hidden search results. Maybe "... were excluded." fits better than "... were skipped."? |
Right now, this isn't the case. If I search for Healthbar prefab's usages, it won't show up in the scene regardless of whether or not it's modified in any way. The only case where variable overrides make a difference is the original case that we've resolved last month: if the searched object is found in an overridden prefab variable, then that variable will show up. I actually thought about your suggestion while developing this feature. I think the desired behaviour mostly depends on the user. How would you suggest I go about this?
Yes.
Your suggestion sounds good to me.
You are not wrong; though I actually wanted it to be eye catching because I think if a user enables this feature but then forgets about it, it could have a very negative impact on their future searches. For example, Prefab A won't show up in the scene at all even though it exists as a child of Prefab B in the scene. I wanted the user to be always aware of this setting. But I'll give white info icon a chance. |
Nice :) For me personally, the meaning / use case of the two setting states are as follows: From that point of view, I would say the HealthBar instance should show up when it has overrides on it. What about searching for the HealthBar script? Let's say there's a HealthBar script directly on the HealthBar prefab and it has a maxHealth SerializedField. When a scene has an override on maxHealth in a Player instance, would that show up when searching for the script? |
I'll try doing it the way you've suggested, thanks again. I'll first see if I can quickly find if a Component or GameObject has any overrides (ideally, I wouldn't want to slow down the search for this feature).
Right now, components are hidden regardless of overrides, same as GameObjects. |
…dant prefab references" which now also apply to C# scripts' and prefab assets' usages (#42)
Done! While deciding if a prefab instance has any overrides, I've decided to exclude just the following properties:
Do note that by "target prefab instance", I mean the Healthbar child object of the Player prefab instance (in this scenario, we're searching for Healthbar prefab's references). If Healthbar instance has any children, they are checked without any exclusions. These exclusions apply only to the root (Healthbar instance). |
Nice 👍🏼 Yes it is a good thought to ignore all of the Transform and GameObject overrides. |
I would like to have a search setting that excludes indirect references.
I.e. when object A is used in prefab P and then both of them are used a couple of times in a scene and I search for A, only show where the scene directly references A and not where it indirectly references A only through the instances of P. (Include of course the one reference in P itself).
There is the setting "Hide redundant prefab variant links" and this works for excluding an unmodifying variant V of P, but it still shows instances of V or P in scenes when searching for A. And there are situations in which this is the desired behavior, so it should be a separate setting.
Some use cases:
Bonus points for still including instances of P that contain a modification on A, but I would be fine with whatever you prefer / is easier to implement.
I think this boils down to showing exactly the places where the GUID of the searched object is actually written in a file?
And thank you for this amazing tool, it has made my life and work a lot easier!
The text was updated successfully, but these errors were encountered: