bevy_mod_scripting icon indicating copy to clipboard operation
bevy_mod_scripting copied to clipboard

Allow state to be passed between reloads

Open shanecelis opened this issue 7 months ago • 0 comments

Problem

When I'm editing a script and the game is running, it resets all the state upon reload.

Solution

I'd like there to be some mechanism to pass state before a script is unloaded to the reloaded script.

I initially thought overloading the on_script_loaded() could accept a state argument and on_script_unloaded() could provide state.

Alternative Solution

But discussion in the discord suggested maybe a particular variable ought to be designated be preserved between scripts.

I was thinking about trying my hand at implementing this, but I haven't done anything yet.

shanecelis avatar May 21 '25 09:05 shanecelis