Exemplo n.º 1
0
    public void UpdateItemFirst()
    {
        if (!(curCharacter is SpecialAdventurer))
        {
            return;
        }
        SpecialAdventurer sadv = (SpecialAdventurer)curCharacter;

        if (sadv.GetWeapon() != null)
        {
            characterEquipedItemImage_1.sprite = sadv.GetWeapon().GetItemImage();
        }
        if (sadv.GetArmor() != null)
        {
            characterEquipedItemImage_2.sprite = sadv.GetArmor().GetItemImage();
        }
        if (sadv.GetAccessory1() != null)
        {
            characterEquipedItemImage_3.sprite = sadv.GetAccessory1().GetItemImage();
        }
        if (sadv.GetAccessory2() != null)
        {
            characterEquipedItemImage_4.sprite = sadv.GetAccessory2().GetItemImage();
        }
    }
Exemplo n.º 2
0
    public void UpdateItemStat(int itemNum)     // button onclick
    {
        if (!(curCharacter is SpecialAdventurer))
        {
            return;
        }
        SpecialAdventurer sadv = (SpecialAdventurer)curCharacter;

        switch (itemNum)
        {
        case 0:
            if (sadv.GetWeapon() == null)
            {
                return;
            }
            itemStatText.text        = sadv.GetWeapon().GetItemStatAsString();
            itemExplanationText.text = sadv.GetWeapon().Explanation;
            itemExplanationPanelBase.GetComponent <RectTransform>().localPosition = characterEquipedItemImage_1.GetComponent <RectTransform>().localPosition;

            break;

        case 1:
            if (sadv.GetArmor() == null)
            {
                return;
            }
            itemStatText.text        = sadv.GetArmor().GetItemStatAsString();
            itemExplanationText.text = sadv.GetArmor().Explanation;
            itemExplanationPanelBase.GetComponent <RectTransform>().localPosition = characterEquipedItemImage_2.GetComponent <RectTransform>().localPosition;
            break;

        case 2:
            if (sadv.GetAccessory1() == null)
            {
                return;
            }
            itemStatText.text        = sadv.GetAccessory1().GetItemStatAsString();
            itemExplanationText.text = sadv.GetAccessory1().Explanation;
            itemExplanationPanelBase.GetComponent <RectTransform>().localPosition = characterEquipedItemImage_3.GetComponent <RectTransform>().localPosition;
            break;

        case 3:
            if (sadv.GetAccessory2() == null)
            {
                return;
            }
            itemStatText.text        = sadv.GetAccessory2().GetItemStatAsString();
            itemExplanationText.text = sadv.GetAccessory2().Explanation;
            itemExplanationPanelBase.GetComponent <RectTransform>().localPosition = characterEquipedItemImage_4.GetComponent <RectTransform>().localPosition;
            break;

        default:
            break;
        }
    }
Exemplo n.º 3
0
    public SpecialAdventurerData(GameObject input) : base(input)
    {
        SpecialAdventurer specialAdventurer = input.GetComponent <SpecialAdventurer>();

        willBossRaid = specialAdventurer.willBossRaid;
        nameKey      = specialAdventurer.nameKey;

        if (specialAdventurer.curBossArea != null)
        {
            curBossArea = specialAdventurer.curBossArea.index;
        }


        Item weaponOrigin, armorOrigin, accessory1Origin, accessory2Origin;

        weaponOrigin     = specialAdventurer.GetWeapon();
        armorOrigin      = specialAdventurer.GetArmor();
        accessory1Origin = specialAdventurer.GetAccessory1();
        accessory2Origin = specialAdventurer.GetAccessory2();

        if (weaponOrigin != null)
        {
            weapon = new ItemData(weaponOrigin);
        }
        if (armorOrigin != null)
        {
            armor = new ItemData(armorOrigin);
        }
        if (accessory1Origin != null)
        {
            accessory1 = new ItemData(accessory1Origin);
        }
        if (accessory2Origin != null)
        {
            accessory2 = new ItemData(accessory2Origin);
        }
    }