Unity tool allowing changes made in play mode to be restored upon stopping the game.
Unity tool allowing changes made in play mode to be restored upon returning to edit mode.
Add the SavePlayModeChanges component to the root of any hierarchies you'd like saved. That's it!
Unlike other tools (such as PlayModePersist), this approximates the common trick of copy/pasting gameobjects from play mode to edit mode.
We couldn't find a way to do this exactly as Unity does, so it serializes and deserializes gameobject hierarchies manually, mostly using UnityEngine.JSONUtility.
It's more of a hammer than a scalpel, but despite its drawbacks it can be a huge time saver so we're releasing it for anyone to use and improve. This tool is experimental. If something goes wrong, backups of your scenes are saved to a Backups folder on your desktop.
The main reason for this is to:
It's a brute force sort of solution. This means:
The SavePlayModeChangesChecker class finds all references to SavePlayModeChanges components on exiting the game. It serializes the entire hierarchy for those objects, and on entering play mode deletes the old hierarchies and creates the new ones.
SavePlayModeChanges is released under the MIT license. Although we don't require attribution, we'd love to hear feedback, and Twitter follows (@inklestudios) are always appreciated!