Ejemplo n.º 1
0
 private void Update()
 {
     if (eventSystem != null)
     {
         if (!eventSystem.currentSelectedGameObject)
         {
             return;
         }
         if (eventSystem.currentSelectedGameObject.GetComponent <ItemButton>() != null)
         {
             if (eventSystem.currentSelectedGameObject.GetComponent <ItemButton>().item.type == ItemObject.ItemType.Equipment)
             {
                 Resources.Load <EquipmentItem>("Items/" + eventSystem.currentSelectedGameObject.
                                                GetComponent <ItemButton>().item.itemName).StatChange();
             }
             else
             {
                 EquipmentStatDifferenceShow.equipmentStatDifferenceShow.hpArrow.SetActive(false);
                 EquipmentStatDifferenceShow.equipmentStatDifferenceShow.hpChange.gameObject.SetActive(false);
                 EquipmentStatDifferenceShow.equipmentStatDifferenceShow.dmgArrow.SetActive(false);
                 EquipmentStatDifferenceShow.equipmentStatDifferenceShow.dmgChange.gameObject.SetActive(false);
             }
             scroll.Scrolling(inventoryButtons, eventSystem.currentSelectedGameObject.GetComponentInParent <ScrollRect>());
         }
         else if (eventSystem.currentSelectedGameObject.GetComponent <SkillButton>())
         {
             scroll.Scrolling(skillButtons, eventSystem.currentSelectedGameObject.GetComponentInParent <ScrollRect>());
         }
     }
 }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (!eventSystem.currentSelectedGameObject)
        {
            return;
        }

        if (buySellPanel.gameObject.activeInHierarchy)
        {
            if (eventSystem.currentSelectedGameObject.GetComponent <ItemButton>() != null)
            {
                if (eventSystem.currentSelectedGameObject.GetComponent <ItemButton>().item.type == ItemObject.ItemType.Equipment)
                {
                    Resources.Load <EquipmentItem>("Items/" + eventSystem.currentSelectedGameObject.GetComponent <ItemButton>().item.itemName).StatChange();
                }
                else
                {
                    EquipmentStatDifferenceShow.equipmentStatDifferenceShow.hpArrow.SetActive(false);
                    EquipmentStatDifferenceShow.equipmentStatDifferenceShow.hpChange.gameObject.SetActive(false);
                    EquipmentStatDifferenceShow.equipmentStatDifferenceShow.dmgArrow.SetActive(false);
                    EquipmentStatDifferenceShow.equipmentStatDifferenceShow.dmgChange.gameObject.SetActive(false);
                }
                if (merchandise.Contains(eventSystem.currentSelectedGameObject.GetComponent <Button>()))
                {
                    scroll.Scrolling(merchandise, eventSystem.currentSelectedGameObject.GetComponentInParent <ScrollRect>());
                }
                else if (sellableItems.Contains(eventSystem.currentSelectedGameObject.GetComponent <Button>()))
                {
                    scroll.Scrolling(sellableItems, eventSystem.currentSelectedGameObject.GetComponentInParent <ScrollRect>());
                }
                else
                {
                    scroll.Scrolling(merchandiseCopy, eventSystem.currentSelectedGameObject.GetComponentInParent <ScrollRect>());
                }
            }
        }
    }