The issue:
I am implementing ES3 into my game, which is a first person game with Tetris-inventory. My player prefab contains all of the inventory scripts and data in this (simplified hierarchy) below. Because I only really need to save the player's inventory data, I went with the approach of adding the "ES3Prefab" component to the prefab, which says it has found 529 references in the prefab. Cool.
I then went through all my custom classes and each reference to a custom class/struct/type I created, and put [ES3Serializable] in front of them.
I then hooked up a button to save and a button to load, to test it, but it does not save the inventory data. It is working because it moves the player transform to the position when it was saved, but their inventory data remains unsaved (or, unloaded).
Code: Select all
Player (Prefab)
<Components:>
PlayerEquippables (What items the player has equipped)
PlayerInventory (Handles storing, adding and removing items to the player's inventory)
My inventory items are a ItemSO (scriptableObject), which are instantiated as an ItemData class with a reference to the ItemSO. The player's equipped items are stored as a dictionay<SlotData, ItemData> where slotData is the player's slot (bag, helmet, primary, secondary, etc) I have added [ES3Serializable] to all the places I can think of, class headers, variable references to all my custom classes... Is that correct?