public void OnBeforeSerialize() { if (tmxFile == null) { tmxFileString = null; } else { tmxFileString = tmxFile.Save(); } }