Hide object in editor

Hello,

Does anyone know a way to hide objects in editor ?
More specifically, I try to hide a Panel object covering my scene, this object is needed in my project and each time I change scene I have to disable the object to work on my scene.
I’ve try layers but Panel is in UI layers so when I hide UI I can’t see the others UI elements, if I add a layer for this specific object and hide it, it doesn"t change because UI layers override the created layer .

Maybe I could find an other way but yet, I’m stuck with disabling.

If you have a solution, share it :smiley:

Thanks

1 Like

You could set .enabled to either true/false.

I’m assuming you want this in play mode in the editor? Assuming so, you could wrap the above in this;

[ExecuteInEditMode]
public class SomeClassInEditor : MonoBehaviour
{
#if UNITY_EDITOR
  void Update()
  {
   Debug.Log("Its time: " + Time.time);
  }
#endif
}

If it’s not for in play mode that’s going to be a problem. You could I suppose set the Z index or something to a value which moves the panel out of view, but that’s not really any different to just enabling/disabling.

You could of course look at the existing tools that have been created in the Asset Store - for example;

Updated Sat Jun 24 2017 20:34

  • Unity Asset Store : Isolate Selected (this one is free and looks like it will do what you want)

See also;

Thanks but, even some tools are interesting, I don’t find my needs :confused:
I’ll stick with disabling/enabling when needed , maybe with more experience i’ll find a way to avoid that.

1 Like

Privacy & Terms