- Home /
Question by
Tom McLean · Mar 28, 2013 at 02:40 AM ·
unityeditorlayerssceneviewlayermask
Control "Layers" dropdown from UnityEditor script
The editor's got a dropdown marked Layers in the top right, that controls which layers are rendered in the SceneView. Is there a way to access this from a script?
(I'm aware that I can change the render layers of a camera, but this only affects the Game view - I want to hide/show layers in the Scene view).
Also, is there a way to have this property only affect a single SceneView, so that I could have several SceneView windows showing different layer configurations of the same area simultaneously?
Comment
Answer by xuanyusong · Nov 13, 2019 at 12:20 PM
//SceneView只看UI层
Tools.visibleLayers = LayerMask.GetMask("UI");
//还原SceneView看EveryThing
Tools.visibleLayers = -1;