public void Save() { //Create a new instance of hotbar save data. HotbarSaveData hotbarSaveData = new HotbarSaveData(); //Loop through each hotbar slot. foreach (HotbarSlot hotbarSlot in hotbarSlots) { //Add the slot's data to the hotbar save data. hotbarSaveData.AddSlotData(hotbarSlot.SlotItem, hotbarSlot.SlotIndex); } //Save the hotbar data. GameSaveHandler.SaveFile("player_hotbar", hotbarSaveData); }
public void Save() => GameSaveHandler.SaveFile("player_inventory", ItemHolder);