Hey, I am trying to save a “Database” of stuff, along with an index in order to have the IDs of the stuff (items,characters, wtvr) be incremented along with how many are currently stored.
(This is being done in an Editor Window)
For some reason when I create the asset file, AND save the assets for the first time, the int index that i have set up along with the List of items get saved correctly in the database asset file. But once I press save again and try to add more items into the database, the index variable is not being incremented. BUT the items List is being added to. So in conclusion to that, the Lists are being saved and loaded properly but the integer variables are not.
I have tried so many ways to get this done but can not seem to get it working.
If anyone has an idea PLEASE help me out. I am running out of solutions.
This is what I am using to save the Database. I got this from a different source. the .Items and .Characters are having no problem at all but the .itemIndex and .charIndex DO save (and properly increment in the inspector) for the first time, but after that, they just stay on their current value and do not increment anymore.
That code was actually edited a few times to try and get this to work… Thats just the last thing I ended up with.
Thanks!