Search Unity

Binary file path handling

Discussion in 'Entity Component System' started by snacktime, Aug 29, 2021.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Threw this together yesterday while refactoring some of our DOTS binary serialization stuff. We had way too many path references scattered about that were difficult to keep track of. So this is sort of a base we can use to get that under control.

    It uses the C# special directory stuff for persistent data due to Application.PersistentDataPath not being thread safe.

    https://gist.github.com/gamemachine/a54e77051774e902444eb4f40107a701
     
    tassarho and Krooq like this.
  2. Krooq

    Krooq

    Joined:
    Jan 30, 2013
    Posts:
    196
    Thanks for sharing @snacktime, I'm definitely going to use this!
    I'm wondering if you might be able to share how you handle save games?
    I'm up to this right now and I really could use some good examples of how to save and load entities, especially with netcode.