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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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