/// <summary> /// Syncs the user interface to inventory of current character. /// </summary> /// <param name="inv">Inv.</param> public void SyncUiWithCharacter(Sheet character) { for (int i = 0; i < character.inventory.items.Length; i++) { if (character.inventory.items [i] != null) { //get the icon from the dispenser to apply to the slot. SetInventorySlotSprite(i, character.inventory.items [i]); } else { ItemSlot slot = GetInventorySlot(i); if (slot != null) { slot.ClearItem(); } } } }