Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug SceneView GUI functions seem to be broken in 2021.2.

Discussion in 'Immediate Mode GUI (IMGUI)' started by Jaimi, Nov 21, 2021.

  1. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,989
    This code has worked to set the DrawCameraMode in 2018.1+, but has quit working in 2021.2. Is there a new way to set this?

    This used to work, but now does nothing:

    Code (csharp):
    1.  
    2.             SceneView.CameraMode newMode = SceneView.lastActiveSceneView.cameraMode;
    3.             if (wireframeOn)
    4.                 newMode.drawMode = DrawCameraMode.TexturedWire;
    5.             else
    6.                 newMode.drawMode = DrawCameraMode.Textured;
    7.             SceneView.RepaintAll();
    8.  
    As well, the GUI.Window no longer works in the SceneView.duringSceneGUI event in 2021.2 either, though other GUI functions seem to work OK. The Window is never drawn and the Window Function is never called.
    I coded around this by moving my GUI to the inspector.

    Is this all expected? I know the SceneView looks nicer, but it broke a bit of stuff for me.
     
  2. Darkgaze

    Darkgaze

    Joined:
    Apr 3, 2017
    Posts:
    316
    GUI.Window doesn't run the method delegate either. No window is created. Seems like 2021.2 has broken GUI methods
     
    Jaimi likes this.
unityunity