To modify lists, use the GDE Data Classes you generated. I’ll use this Warrior item to demonstrate how to modify its data.
List types are saved by calling the Set method.
GDECharacterData warrior = new GDECharacterData(GDEItemKeys.Character_Warrior); // Modify the list any way you like. // Add, Remove, or Change entries // Then call the generated Set method warrior.inventory_ids = 314; warrior.inventory_ids.Add(1124); warrior.inventory_ids.RemoveAt(4); // Make sure to call Set!! warrior.Set_inventory_ids();
Set methods are generated for every list field in a schema.
Please note GDE no longer uses PlayerPrefs to persist modified data. To persist your data, call the new Save method when it is convenient in your game. Be sure to save as often as you need. Web builds still use PlayerPrefs (Save and ClearSaved methods have no effect in Web builds).
// To persist modified data call.. GDEDataManager.Save(); // To clear any persisted data call.. GDEDataManager.ClearSaved();