Hey thanks for the suggestion, it had occurred to me too, but the thing is, making the data in edit mode persist in play mode is a bit tricky. But your suggestion encouraged me to find a solution and I already came up with a trick to make it work.
Very useful! However, the auto-saver is not working for me. What could it be?
Also, can I apply changes made from code as well once the auto-saver works again? I’ve been trying to get the auto-saver to work myself but I don’t know how to keep track of the changed objects in the editor script once play mode exits.
Hey, at the moment PlayModeSave is not designed to work as you think. Right now, the tool allows you to take a snapshot of a transform and save it when exiting play mode. No matter how you modify the transform after saving it, it only keeps the values you saved before and applies them when you exit play mode. However, I think I’ll add the option to save the transform values as they are just before exiting play mode, or in other words make the transforms persistent.
BTW, the tool you mention looks great and allows you to make other components persistent not just transforms. But if what you need is to take a snapshot, you can use PlayModeSave.
Got it! I would love it if you could make the transform values persistent in such a way that I could run the program, make the changes I want through code alone, then simply exit play mode. The other tool seems amazing but it actually caused some problems with other things that should not have been affected.
If you make these changes in the next couple of days please do let me know because it would be very useful to me!
Hey, version 2.0 is available and now you can save changes made in play mode to any component, built-in or custom. You can also save component values as they are when exiting play mode (that is, persistent components until exiting play mode). Check it out.
Hi there! Thanks for your asst.
Is it possible to use your asset to save ScriptableObject changes in Play Mode (i.e. “Save Now”) ?
If not, would it be hard to add such feature? Would really appreciate it
Hey, I’m sorry, but I think I’m not understanding what you want to do. ScriptableObjects are assets, so they are persistent between sessions and do not need to be saved. Play Mode Save only saves changes to serializable components, that is, all built-in components and custom components with serialized fields. However, the tool has a limitation: It does not save changes to objects and components created in play mode. Is this limitation related with you want to do?
Could you please explain your case more specifically in order to understand what you want to do.
I have a class which is derived from ScriptableObject and an asset of such type.
During the play mode I’m able to modify its fields and later, upon exiting the play mode its contents are being serialized by Unity and saved to the corresponding asset.
However if Unity crashes or hangs because of some problem (that can happen for example after even a small change to a C# script), its contents are not being saved, and all my work is lost.
Thus, it would be awesome to be able to “Save now” such an asset during the play mode or (that one is optional) configure an auto-save (with some period of time or after each change).
However I’m not sure how to use it in a proper way in such scenario, and maybe it would be useful to include it to your asset for the sake of completeness
Glad to hear that the new feature is working.
About the new features you mention, I’ll keep them in mind for future versions.
Thanks for helping me improving the tool.
You’re right, unfortunately it seems like that property doesn’t have a serializable backing field. But I can fix it. It will be available in the next version.
Awesome thanks! Ya I would love to use your asset as it seems immensely helpful, but hopefully you can understand that if I’m not sure which aspects of components will or will not be saved, then that uncertainty renders it to a large extent unusable. Looking forward to trying the next version though and will be following the progress! Cheers.
Sorry for the double post… I realize I spoke a bit in hyperbole there. It’s not that big of a deal to keep a closer eye on what’s being saved, and I just wanted to say that the speed of that update today was awesome. Appreciate it!