- Home /
Question by
pashustwo · Jul 30, 2013 at 06:01 PM ·
cameralayerseditorwindowsceneview
How to set SceneView culling mask programmatically?
Hi,
I want to write an EditorWindow tool to allow easy switching between different sets of Layers in the Editor SceneView (instead of laboriously clicking on the Layers drop down). Naively I think that doing
SceneView.lastActiveSceneView.camera.cullingMask = 1<<4 | 1<<10;
should work, but it has no effect.
Any ideas??
Cheers,
Peter
Comment
Answer by Skittlebrau · Apr 23, 2014 at 03:25 PM
This seems to work:
Tools.visibleLayers = mask;
SceneView.RepaintAll();
In my case, the RepaintAll was necessary to see the effects immediately, but perhaps it's not necessary in some contexts.