Search Unity

Saving changes made in an EditorWindow to the meta file

Discussion in 'Scripting' started by fwalker, Jun 9, 2020.

  1. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    255
    Is there no way to save changes that have been made to a class that extends the EditorWindow to the classe's metadata file?. Seems like that would be the right place, rather than saving things in EditorPrefs where they will be forever there if the tool is deleted? Or on a separate json file that could get lost and forgotten?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,752
    Do you mean the .meta file associated with the actual C# script file? Those metafiles are pretty much Unity's domain, although obviously the asset itself influences them.

    What are you actually trying to do? That might be a better place to start because it is very unlikely you are the first person to try it... :)
     
  3. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    255
    I just want to save the changes made to parameters in my custom EditorWindow when I close the window. So they are there the next time I open it.