Search Unity

Bug? With InteractivePreviewGUI on Unity2019

Discussion in 'Scripting' started by Elendow, Aug 14, 2019.

  1. Elendow

    Elendow

    Joined:
    Apr 9, 2014
    Posts:
    87
    Hi there,

    I have an asset that uses an InteractivePreviewGUI to show an animation. I use the exact same code in a EditorWindow and in a CustomInspector and since now it worked without problems.

    But in Unity2019 it's behaviour is... weird. Here some screenshots.



    On the left is working as intended on a EditorWindow, but when using the PreviewGUI on the CustomInspector the render is missplaced. It's weird because I detect mouse events within the rect and they work perfectly fine.



    Also, if I detach de preview window it works fine. It's only when its attached.

    My code is something like this:
    Code (CSharp):
    1.  
    2. public override void OnInteractivePreviewGUI(Rect r, GUIStyle background)
    3. {
    4.         Handles.DrawCamera(r, pc);
    5. }
    6.  
    Any hints to solve this?

    Thanks.
     
    Last edited: Aug 14, 2019