yasirkula / UnityRuntimeInspector

Runtime Inspector and Hierarchy solution for Unity for debugging and runtime editing purposes
MIT License
1.68k stars 135 forks source link

Filtering Objects and Layer Filtering #27

Closed Bit00009 closed 3 years ago

Bit00009 commented 3 years ago

Hello @yasirkula Your assets are very great and I'm sad I found them so late... There's 3 things I want to know how to perform in your library : 1- How can I hide some certain objects from Hierarchy? 2- How can I change the Hierarchy root to a certain object, I mean imagine I have a object named MyScene and all of my visual objects are children of it. Now I want to show only children of MyScene in Hierarchy view instead of Scene. I know it's possible using current Expose Scene option but I want to do it as multiple roots. 3- How can I filter objects using their layer id? ( I believe this question has the same answer of 1 )

Regards, Ultran

yasirkula commented 3 years ago

Hi,

1-3)

You can register to the GameObjectFilter delegate of the hierarchy to hide some objects from the hierarchy (or, you can add those objects to RuntimeInspectorUtils.IgnoredTransformsInHierarchy and they will be hidden from all hierarchies; just make sure to remove them from this HashSet before they are destroyed)

2) First, you should disable RuntimeHierarchy's Expose Unity Scenes and Expose Dont Destroy On Load Scene properties. Then, you can simply add a PseudoSceneSourceTransform component to MyScene.

Bit00009 commented 3 years ago

Wow, I'm impressed.