Unity editor save to DB

Hi,

I would like to save the position of an object to an external database from within the editor (not at runtime). My question, which event in editor should I use to save it automatically, e.g. when I re-position the object this action, triggers the code to save the object new position.

I’m not sure there is a hook for this directly. Checking isDirty came to mind, but that doesn’t clear until the scene is saved.

So you’ll pretty much have to check every ‘frame’.

1 Like

Which you probably want to do anyway. If a user click-drags on one of the XYZ fields in the Transform inspector I certainly wouldn’t want to spam off a billion calls to some database service.

Not to mention just typing into a field - or typing a mathematical expression in which case, what do you even save?

1 Like

isDirty is an idea, thanks. Save operation does not need to occur immediately after a modification. I am going to try it after I finish the custom save editor window I started implementing in the mean time, as fail safe mechanism :slight_smile: