Search Unity

Assets [WIP] Player Pref Anything. An easy to use way to save data.

Discussion in 'Works In Progress - Archive' started by boati, Sep 30, 2019.

  1. boati

    boati

    Joined:
    Jan 28, 2016
    Posts:
    6
    upload_2019-9-29_16-9-11.png

    Info
    Player Pref Anything is fast, easy to use, and easily customized FULL replacement of the default Unity PlayerPrefs. Easily set or get any value right from the editor. Mark variables in your script as PlayerPrefs and automatically have them update across the entire project. Export prefs into builds, allowing for default settings of prefs without additional setup scripts. Overwrite the back-end controller and completely modify how and where pref data is stored.

    About
    This was made as a solution to a common problem I've heard frequently from new unity users. Storing data is not straight forward, serialization is not easily understood, and there is not much info out there for medium sized projects without diving into complex save systems. That combined with Untiy's limited serialization capabilities, new users will tend to flock to converting data to a string or JSON, and saving it in Unity's PlayerPrefs. While this works, unpacking that data later is not easily done quickly. It's a hassle to manage, and it doesn't need to be that way.

    Player Pref Anything uses the wonderful open source Odin Serializer to allow for ANYTHING to be easily stored and loaded with just 1 call. https://github.com/TeamSirenix/odin-serializer

    Current Features
    • Store ANYTHING easily in a shared pref cache.
    • Easily drop in and replace Unity's PlayerPrefs and immediately benefit from the speed of Odin
    • Supports multiple platforms. (Tested in WEBGL, Windows, and OSX)
    • Customizable storage pipeline
    • In-editor modifying of Prefs
    • Carry prefs over into build as default values
    • Mark variables with the PlayerPref attribute to have them tied to a key
    • Easily initialize said values right in the editor
    • Extensive logging which can easily be turned off. Persists into builds.
    • Full auto-generated documentation from DocFX
    Why are some types unsupported?
    This is only on the [PlayerPref] Attribute. Some fields have odd serialization behavior which is difficult or impossible to handle cleanly. It's possible a future update more types will be supported, but at this time the only unsupported attribute targets are any arrays / lists, and serialized objects (note: Serialized objects with variables marked as [PlayerPref] will work just fine)
    Images
    upload_2019-9-29_16-28-22.png
    upload_2019-9-29_16-29-23.png

    upload_2019-9-29_16-28-37.png

    Demo
    I'd love to have a demo version, although I'm not too sure how that might work yet. It's something I might look into if there is interest.

    Links
    Discord: https://discord.gg/GTTbnde
    Documentation: https://aseward.gitlab.io/playerprefanything/

    Feedback
    I am looking to gauge interest on this project, and to extend an invitation to beta test the project. I'd also love to hear your feedback on my presentation of the info-images, and what you'd like to see. The full album is here: https://imgur.com/a/1x0Xwc4

    Feel free to join the discord if you're interested in beta testing the project.
     

    Attached Files:

    Last edited: Sep 30, 2019
  2. boati

    boati

    Joined:
    Jan 28, 2016
    Posts:
    6
    Keeping this updated, AOT (WebGL / IL2CPP) platforms are supported properly now and should work with no issues.
     
  3. boati

    boati

    Joined:
    Jan 28, 2016
    Posts:
    6
    Wrote a ton of tests today, went through and built for all the LTS editor versions 2017+, ensured it built for webgl, windows, osx and linux. Submitted to the asset store for review, fingers crossed.