Search Unity

Question Editor.OnPreviewGUI Refresh

Discussion in 'Editor & General Support' started by jessee03, Nov 24, 2022.

  1. jessee03

    jessee03

    Joined:
    Apr 27, 2011
    Posts:
    729
    Is there a way to refresh Editor.OnPreviewGUI if the gameObject is changed? Right now I have to close my editor window and re-open the editor window, then assign a new gameObject to get the preview gui to update with the correct new model assigned to the gameObject field. Below is the documentation of the code I am using.

    https://docs.unity3d.com/ScriptReference/Editor.OnPreviewGUI.html