public void Load() { //Create a new instance of hotbar save data. HotbarSaveData hotbarSaveData = new HotbarSaveData(); //Load the hotbar data. GameSaveHandler.LoadFile("player_hotbar", hotbarSaveData); //Loop through each hotbar slot in the loaded data. foreach (HotbarSlotData hotbarSlotData in hotbarSaveData.hotbarSlotData) { //Set the slot's item to the item loaded from the hotbar save file. hotbarSlots[hotbarSlotData.slotIndex].SlotItem = hotbarSlotData.hotbarItem; } }
public void Load() { GameSaveHandler.LoadFile("player_inventory", ItemHolder); onInventoryItemsUpdated.Raise(); }