yasirkula / UnityRuntimeInspector

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

How to hide certain gameobjects from runtime hierarchy within my scene and pseudoscenes #55

Closed hemanth2004 closed 3 months ago

hemanth2004 commented 3 months ago

I would like to hide a certain gameobjects that are descendants of my pseudoscene and all of their children too. How do I do this? (New to raising issues so apologies if this isn't the right place the ask)

yasirkula commented 3 months ago

Hi, quoting the documentation:

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)

runtimeHierarchy.GameObjectFilter = ( Transform obj ) =>
{
    if( obj.CompareTag( "Main Camera" ) )
        return false; // Hide Main Camera from hierarchy

    return true;
};
hemanth2004 commented 3 months ago

Ohk Thats helpful thanks! (and sorry!) I love your work, by the way. Big fan.