I have a prefab object in the scene. This object has a custom inspector and various editor features to provide visualization to the artist. Part of this visualization creates child objects that are solely for vis purposes and should NOT be saved as part of the prefab.
Right now an artist has to remember to turn these off before saving the prefab but eventually someone will forget and make a right mess of things.
So I tried hooking into the ISerializationCallbackReceiver methods to do things before and after serialization. I thought, I could destroy the child vis objects just before serialization and then recreate them after.
Unfortunately Unity won’t let me do this. Apparently because serialization runs on a separate thread, I can’t actually manipulate my object in ways such as finding/destroying/creating sub objects.
Has anyone else been in a similar situation and found ways to handle it?