First, like any other integration, make sure to enable the Easy Save 2 integration in the integrations window.
Navigate to your ES2Init.cs file, and paste the following 2 lines of code at the bottom of your file:
ES2TypeManager.types[typeof(Devdog.InventorySystem.Models.ItemCollectionSerializationModel)] = new ES2UserType_DevdogInventorySystemModelsItemCollectionSerializationModel(); ES2TypeManager.types[typeof(Devdog.InventorySystem.Models.InventoryItemSerializationModel)] = new ES2UserType_DevdogInventorySystemModelsInventoryItemSerializationModel(); ES2TypeManager.types[typeof(Devdog.InventorySystem.Models.InventoryCurrencySerializationModel)] = new ES2UserType_DevdogInventorySystemModelsInventoryCurrencySerializationModel();
Your code should look similar to the image below:
Once done simply save the file and close it. Unity will re-compile; This will take several seconds.
To save and load a collection all we have to do is add a EasySave2CollectionSaverLoader component to that collection.
All integration specific scripts can be found under Integrations > *
And that's it, items and currencies will now auto. be loaded when you start the game and saved when you close it.