Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Open Source Unity Inventory Framework

Discussion in 'Assets and Asset Store' started by Ash-Blue, Jul 6, 2023.

  1. Ash-Blue

    Ash-Blue

    Joined:
    Aug 18, 2013
    Posts:
    102
    I just finished a new open source inventory framework for Unity called Elastic Inventory.

    https://github.com/ashblue/unity-elastic-inventory

    I've written a dozen or so inventories in multiple languages over the past decade plus. This is really the inventory system I've always wanted. As far as I know it should be able to do anything you want for a game. As all of the code is non-implementation specific. You could use it out of the box for a point and click adventure game. Or implement something extremely complex like Dark Souls' items, flask, and weapon system.

    Looking for feedback and do let me know if you give it a spin.

    PS Would love to bring this to the Unity Asset Store. Currently installable as a package. Is there a way to easily send a deployable Unity package to the asset store? Would need to be able to do this automatically with CI/CD. As I use Semantic Release to automate all deploys.
     
    CodeRonnie likes this.
  2. CodeRonnie

    CodeRonnie

    Joined:
    Oct 2, 2015
    Posts:
    291
    Have a look at this for deploying to the asset store as a package for the package manager. (I haven't tried it myself.)

    https://github.com/needle-tools/hybrid-packages

    There are also some guidelines they prefer for how packages are organized, like organizing into certain directories like Editor, Runtime, ~Samples. I'll post a link to that as well if I find the documentation.
     
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,109
    I dislike the idea of string-based indexing of items (“gold”). That feels unnecessarily brittle as opposed to integer indexing which would allow one to use enums without mapping indexes to strings or worse, calling ToString() on every access. Integer indexing would also speed up dictionary lookup, which I suppose are used internally.
     
  4. Ash-Blue

    Ash-Blue

    Joined:
    Aug 18, 2013
    Posts:
    102
    @CodeRonnie this is awesome thank you. Thankfully my package is already organized for best practices according to Unity. I'd still have to manually run this process vs an automated deploy. But this definitely feels like a step in the right direction.
     
  5. Ash-Blue

    Ash-Blue

    Joined:
    Aug 18, 2013
    Posts:
    102
    @CodeSmile It actually supports definition references, entry references, and IDs. So you can use it any of the ways you mentioned. I agree with you the references by ID are brittle. But they're great for rapid prototyping. I like using them for currencies and simple recurring things I can just map to a static string in a file. Easier than maintaining a giant config file. But yeah everything else I use is a ScriptableObject reference.