Correct Logic for undating TextAsset while App Playing?

Can someone check my logic here please?

When the app is not playing. You can change the data of a TextAsset on an EditorWindow, but to save it you need to save to the undelaying XML file, then by calling AssetDatabase.Refresh the TextAsset will automatically reload the new XML.

However, this will not happen if the application is running. So in order to make a real time changes to that TextAsset the application would have to “monitor” the XML file for changes, and reload the file as needed and use the data directly but the textAsset will remain un-updated, until? not sure when.

Or is there an easier way? Can I have the EditorWindow send and event to the GameObject? Or have the GameObject listen to and EditorWindow’s event even if the App is running?

What is the correct way to go about this.

To summarice. I have an GameObject with a TextAsset and a Custom EditorWindow that makes changes to the data of that text asset (which happens to be an XML file). I want to be able to have the Application reload the data while it is running, in the case when the EditorWindow is use to make changes to the data.

Thanks

Didn’t quite understand what you need. If you in any case need changes done in play mode to be “saved” when the app stops playing, that’s a persistence thing - look for PlayModePersist plugin.

He’s correct.

How I solved this issue in my project was to write the changes to disk and when gameplay ends, I have a Unity GameObject menu selection that applies the changes.

Thank you. Ya I think that makes sense.