Remember UI when exiting playmode

I’m building a simple animatic tool that allows me to overlay a video as a UI image on screen, along with some scale and transparency controls. I’m using a scriptable object to hold the current scale/alpha settings, so if they are changed during runtime and a new scene is loaded, they hold the same values into the next scene load. The scriptable object settings are loaded on start(), and can be affected by some UI buttons. They can also be edited on the parent component using inspector buttons before the scene is played.


The issue I’m having is that when the scene closes, it reverts to the pre play state even though the settings are up to date in the scriptable object. I think I understand why this is happening, but wondering if there’s a way to auto update the scene with the SO settings when exiting play mode. I’ve tried calling my methods in OnDisable() and in OnDestroy() but doesn’t seem to help. Is there anyway to set this?

I managed to solve this with just by adding ExecuteInEditMode to the class. It appears that the Start() method is called when the scene exits which triggers my set methods and remembers the gameplay state.