Beispiel #1
0
        public void SetObject(Position position, CharacterItem item)
        {
            switch (position)
            {
            case Position.COUCH:
                couch.SetSprite(item.sprite);
                break;

            case Position.TABLE:
                table.SetSprite(item.sprite);
                break;

            case Position.FURNITURE_INDOOR:
                furniture_in.SetSprite(item.sprite);
                break;

            case Position.HOBBY_TABLE:
                hobby_table.SetSprite(item.sprite);
                break;

            case Position.FURNITURE_OUTDOOR:
                furniture_out.SetSprite(item.sprite);
                break;

            default:
                break;
            }
        }
Beispiel #2
0
 void AddSpecialItem(CharacterItem item)
 {
     if (ItemsManager.I.IsSpecialAvailable(item))
     {
         specialItems[firstSpecialSlotIdx].SetSprite(item.sprite);
         displayedSpecialItems.Add(item);
         firstSpecialSlotIdx++;
     }
 }
Beispiel #3
0
 public void SetItem(CharacterItem item, Position position)
 {
     if (slots == null)
     {
         slots = GetComponentInChildren <SlotsManager>();
     }
     slots.SetObject(position, item);
     composition[position] = item;
 }
Beispiel #4
0
 public bool IsSpecialAvailable(CharacterItem item)
 {
     if (usedSpecialItems.Contains(item))
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Beispiel #5
0
        public void Select(int i)
        {
            GameManager.I.INTERACTING = false;

            CharacterItem selectedItem = null;

            if (i >= 0 && i < (displayedRegularItems.Count + displayedSpecialItems.Count))
            {
                if (i < displayedRegularItems.Count)
                {
                    selectedItem = displayedRegularItems[i];
                }
                else
                {
                    selectedItem = displayedSpecialItems[(i - displayedRegularItems.Count)];
                }
            }


            if (selectedItem.isSpecial)
            {
                var itemInPos = HomeManager.I.GetItemInPosition(currentPos);
                if (itemInPos == null || !itemInPos.isSpecial)
                {
                    ItemsManager.I.AddUsedSpecialItem(selectedItem);
                }
                else
                {
                    ItemsManager.I.RemoveUsedSpecialItem(itemInPos);
                    ItemsManager.I.AddUsedSpecialItem(selectedItem);
                }
            }
            else
            {
                var itemInPos = HomeManager.I.GetItemInPosition(currentPos);
                if (itemInPos == null || itemInPos.isSpecial)
                {
                    ItemsManager.I.RemoveUsedSpecialItem(itemInPos);
                }
            }

            HomeManager.I.SetItemInPosition(selectedItem, currentPos);

            HideItems();
        }
Beispiel #6
0
 public void SetItemInPosition(CharacterItem item, Position pos)
 {
     activeHome.SetItem(item, pos);
 }
Beispiel #7
0
 public void RemoveUsedSpecialItem(CharacterItem item)
 {
     usedSpecialItems.Remove(item);
 }
Beispiel #8
0
 public void AddUsedSpecialItem(CharacterItem item)
 {
     usedSpecialItems.Add(item);
 }
Beispiel #9
0
 void AddRegularItem(CharacterItem item)
 {
     regularItems[firstRegularSlotIdx].SetSprite(item.sprite);
     displayedRegularItems.Add(item);
     firstRegularSlotIdx++;
 }