You are browsing as a guest. Sign up (or log in) to start making projects!

4h 16m 33s logged

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

0
32

Comments 0

No comments yet. Be the first!