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.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Editor.OnPreviewGUI Refresh

Discussion in 'Editor & General Support' started by jessee03, Nov 24, 2022 at 5:25 AM.

  1. jessee03

    jessee03

    Joined:
    Apr 27, 2011
    Posts:
    697
    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
     
unityunity