Would be awesome if there was just a simple flag like [RetainChangesFromPlayMode] that you could put above certain variables, in the same manner you put [System.Serializable].
And this [RetainChangesFromPlayMode] would basically mark a variable so it won’t reset any changes you make to this variable while fiddling with it while your game is running.
It would be good to have a way to commit changes though. I’ve often done things like adjust camera height etc while the game is running only to hit stop and remember that everything is going to reset.
Not sure if there’s already a way to “commit changes”. If there is I’d love to know. If there’s not, I’d love for it to be added.
I guess it could only be applied to certain situations though - like the transform on the camera etc.
I’m running Pro on Mac, maybe that’s why I get different a behaviour. Just to be clear, we’re talking about changing values on Hierarchy static objects and / or prefabs in the project tab from the Inspector, right?
Im on Unity Pro on OSX as well, and no I’m not referring to changes done on objects in the Project tab. I’m referring to changes made on GameObjects, actually in your scene, under the Hiearchy tab.
Changes made to things in the Project tab are retained from being in playMode. I was actually trying to figure out how to exploit this. By having a ScriptableObject class that has all my variables I’d want to adjust during run time, and then I’d adjust it as an object from the Project Pane, and hopefully variable changes would be retained. But I unfortunately can’t figure out how to get a script still in the project pane to display its public variables like int and rect to be edited. Does anyone know how to do that?