Editor Window not reading recently saved XML.

Hi, first of all, sorry for my poor english…

I’m writing a EditorWindow class where I can change some values and them save the new values in a XML.

When i hit the “Save in XML” button (image below), and them a hit the “Load from XML” button, the values return to the previous values (before the last save)!!

So…i thought the values are not beeing corretly saved, but if I do the following steps:

  1. Hit the “Save in XML” button.
  2. Open the generated XML in another program (like Notepad++, the values are correct)!
  3. Hit the “Load from XML” button.

The values are saved and then loaded succesfully! The values are beeing saved in XML but it seens that the Unity do not load the last saved XML, until I open the XML or restart the Unity…

WHY?!?!

I don’t know if the question was clear, but if someone have any ideia of whats is going on, please help me! o/o/

Thanks!

Weird!

Are you saving the XML file to a folder inside your Unity Assets Folder? If so, after you save the file, try inserting the line

AssetDatabase.Refresh();

that might help.