コード例 #1
0
        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;
            }
        }
コード例 #2
0
 public void Load()
 {
     GameSaveHandler.LoadFile("player_inventory", ItemHolder);
     onInventoryItemsUpdated.Raise();
 }