Search Unity

OnInspectorUpdate without inheriting from EditorWindow?

Discussion in 'Editor & General Support' started by jimmio92, Sep 10, 2018.

  1. jimmio92

    jimmio92

    Joined:
    Nov 3, 2009
    Posts:
    31
    Hello all,

    I've currently got a script that inherits from EditorWindow, and I do depend upon OnInspectorUpdate, though I could use any source of "update". Basically, I'm requesting information from the PackageManager and to actually use it, I have to poll for an IsCompleted variable. I'm trying to move all the functionality to be in the menu bar at the top of the screen instead of a GUI window, and without some way to update, I can't do so.

    Should I inherit from ScriptableObject instead of EditorWindow if all I'm doing is providing public static functions for the menu? How can I update in said script?

    Thanks,
    Jim
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Last edited: Sep 13, 2018
  3. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,317
    I would recommend you use ScriptableObject if you don't want to have an EditorWindow. You can subscribe to EditorApplication.update for an update callback.