persistent entities… again
kinda scrapped most of the first attempt at persistent entities and decided to redo it
instead of setting persistence in the editor, I went with something closer to Unity’s DontDestroyOnLoad, where scripts explicitly mark entities as persistent. makes more sense and is a lot less weird around scene changes.
(i.e this.SetPersistent(true); )
changes
scripting
added:
entity.SetPersistent(true)entity.IsPersistent()
persistence
persistent entities are tagged before the scene unloads, serialized normally, then re-injected and reparented when the new scene loads.
the persistence tag itself isn’t serialized, so it won’t accidentally end up saved into the scene
dedup
added some basic deduplication so persistent entities don’t get duplicated if the new scene already contains an entity with the same name.
its name based for now… not very great, but good enough
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.