Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows all GameObjects in the scene with hideFlags, so you can debug them.
using UnityEngine;
using UnityEditor;
public static class HideFlagsUtility
{
[MenuItem("Help/Hide Flags/Show All Objects")]
private static void ShowAll()
{
var allGameObjects = Object.FindObjectsOfType<GameObject>();
foreach (var go in allGameObjects)
{
switch (go.hideFlags)
{
case HideFlags.HideAndDontSave:
go.hideFlags = HideFlags.DontSave;
break;
case HideFlags.HideInHierarchy:
case HideFlags.HideInInspector:
go.hideFlags = HideFlags.None;
break;
}
}
}
}
@ozgurgurbuz167
Copy link

ozgurgurbuz167 commented Nov 8, 2022

I've been working around editor scripts and I've come across with object hiding at some point. However they've managed to stay hidden out of my control. This script helped me a lot, so thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment