Home

Awesome

Save Play Mode Changes in Unity

Unity tool allowing changes made in play mode to be restored upon returning to edit mode.

Usage

Add the SavePlayModeChanges component to the root of any hierarchies you'd like saved. That's it!

Method

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.

Advantages

The main reason for this is to:

Disadvantages

It's a brute force sort of solution. This means:

How it works

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.

Other issues

License

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!