Search Unity

Unable to switch between baked lightmap and shaded in scene view mode

Discussion in 'Scripting' started by unity_MXlt2J-B4KLZuQ, Jun 11, 2018.

  1. unity_MXlt2J-B4KLZuQ

    unity_MXlt2J-B4KLZuQ

    Joined:
    Jun 5, 2018
    Posts:
    4
    Hello,

    I am trying to switch DrawCameraMode options through editor script. But its not working.

    I am getting null exception for the below line
    SceneView.currentDrawingSceneView.cameraMode

    I am trying to switch the DrawCameraMode options with the following piece of code.

    CameraMode cameraMode = SceneView.currentDrawingSceneView.cameraMode;
    cameraMode.drawMode = DrawCameraMode.BakedLightmap;

    I am using Unity 2018.1.2f1

    Thanks in advance..