- Home /
Is it possible to save changes made in editor in playe/paused mode?
Is it possible to save changes made in editor in play/paused mode? By default changes made while project is running are not saved to scene. I know this is good and done on intention. But is it possible to force Unity update scene or modified prefab when in play mode?
$$anonymous$$ight be able to take an opposite approach by setting your scripts to [ExecuteInEdit$$anonymous$$ode]... Though it may be too limited depending on your needs.
http://docs.unity3d.com/Documentation/ScriptReference/ExecuteInEdit$$anonymous$$ode.html
Thanks, I know about that attribute but it would not help. The reason is sometimes I forget I am on pause and start to modify my scene. And after some work the only solution remaining is to press stop and loose everything done.
Answer by GameVortex · Jan 09, 2014 at 01:24 PM
You can but it requires custom editor scripts. I would recommend the **Playmode Persist** plugin from the asset store. It is not free though.
An alternative is to make sure you do not accidentally start editing in playmode, one way I have heard works great is to set your playmode tint color to something vastly different from normal editor color. You can do that if you go to Edit - Preferences - Colors. There you can edit Playmode Tint. Set it to something bright like all Green or similar and you will definitely know from the entire editor that you are in playmode and then probably not start editing by accident.
If after all that you have still accidentally edited something in playmode you can still save something by making it a prefab or copy specific components while you are in edit mode. This depends on what you have edited though, but take for example if you have a GameObject with a controller script that has a lot of values, and you edit all those values in playmode. You can then drag the gameobject into the Asset list and you will have made it a prefab, then stop playmode and drag the prefab out into the scene again. You can also instead rightclick on the component itself and choose: Copy Component. Then stop playmode and right click again on the same component and choose: Paste Component Values.
thanks, I was doing something random (overloading scene to test fps) but I worked like 30 $$anonymous$$s on play mode and thanks to you, I created a empty gameobject, put all in it and made it a prefab. Thanks for my half-hour.
Your answer
Follow this Question
Related Questions
Cannot dash in left-down, left-up and right-down directions? 2 Answers
I need help with the player's health points 1 Answer
Player Positioning Based on Previous Scene 1 Answer
How can I parent the player to another GameObject (Vehicle)? 2 Answers
Issues with player prefabs when I try to teleport it 1 Answer