void SaveProfile() { if (!CheckPlaying()) { return; } string prevProfile = MadLevelProfile.profile; MadLevelProfile.profile = selectedProfileName; var path = EditorUtility.SaveFilePanel( "Save Profile", "", MadLevelProfile.profile + ".profile", "profile"); if (path.Length != 0) { string levels = MadLevelProfile.SaveProfileToString(); System.IO.File.WriteAllText(path, levels); EditorUtility.DisplayDialog("Profile Saved!", "Profile saved to " + path, "OK"); } MadLevelProfile.profile = prevProfile; }