Saving state. Now can exit out of the editor or game dependently.