Ejemplo n.º 1
0
    public void PutItemBackBeforeSave()
    {
        PartyMember member = partyPanel.LookUpSelectedPartyMember();

        if (IsAnItemSelected())
        {
            GiveItem(selectedItem.item);

            if (member != null)
            {
                int i = 0;
                foreach (Item item in member.GetEquipment())
                {
                    if (item != null && item == selectedItem.item)
                    {
                        member.equipment[i] = null;
                        break;
                    }
                    i++;
                }
            }
        }
        selectedItem.DirectlyNullifyItem();
    }
Ejemplo n.º 2
0
// Load the previous items
    public void RestoreUIForCurrentEquipment()
    {
        PartyMember member = LookUpSelectedPartyMember();

        if (member != null)
        {
            for (int i = 0; i < slots.Length; i++)
            {
                UIItem uiItem = slots[i].GetComponentInChildren <UIItem>(true);
                if (member.equipment[i] != null)       // The item has been swapped out
                {
                    uiItem.item = member.equipment[i]; // Set as item
                    uiItem.SetSprite(uiItem.item);
                }
                else
                {
                    uiItem.DirectlyNullifyItem();
                }
            }
        }
    }