private void SaveSettingsFile() { string xml = settings.ToXML(); try { string fileName = "settings.xml"; string filePath = Application.streamingAssetsPath + "/DebugTools/"; new FileInfo(filePath).Directory.Create(); StreamWriter file = new StreamWriter(filePath + "/" + fileName); file.Write(xml); file.Flush(); file.Close(); AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate); } catch (Exception e) { Debug.LogException(e); } }