Hello,
I have an object in my scene which I would like to appear in wireframe in the editor view. I firstly tried to change its state with: EditorUtility.SetSelectedRenderState(r, EditorSelectedRenderState.Wireframe);
but it works only when the shaded mode is changed to wire.
So now I try to hide the object in the scene view and draw it with gizmo. It works fine, but I have to change the layer of the scene camera manually. Is there a way to change it via script like this :
Debug.Log(SceneView.lastActiveSceneView.camera.cullingMask);
SceneView.lastActiveSceneView.camera.cullingMask = 0;
Debug.Log(SceneView.lastActiveSceneView.camera.cullingMask);
This code does not work, the culling mask never changes.