The scenario can be minimised to be the following:
I have an empty GameObject which has a child object in the hierarchy. The child object has a SpriteRenderer component attached, as well as an actual sprite such that it is visible in the editor.
This child object has the HideFlag **HideInHierarchy** meaning that it is still visible in the editor, however not in the hierarchy. This also means that the child object is unselectable in the editor (i.e. when trying to select the child object in the editor, Unity acts as if the child object is not there at all and tries to select whatever is behind the child object, if anything).
I wish to enforce that while the **HideInHierarchy** flag is active on the child object, the empty GameObject (the parent object) is selected when I try to select the child object in the editor.
Is there any way to achieve this behaviour?
I have tried using SelectionBase on the empty GameObject (the parent object) with no luck.
Any help is appreciated.
↧