int onClick(int slotIndex, GameIDData slotData)
    {
        if (sourceIndex == -999)
        {
            sourceIndex = slotIndex;
            source      = slotData;

            slotSource.gameObject.SetActive(true);

            int price = 0;

            switch (_type)
            {
            case Type.Equip:
                slotSource.setData(UIChallengeItemSlot.Type.Equip, source);
                price = GameDataManager.instance.composePrices[source.partsData.character + source.partsData.type + RareType.SERVER_CHARACTER[originalData.rare]];
                break;

            case Type.Skill:
                slotSource.setData(UIChallengeItemSlot.Type.Skill, source);
                price = GameDataManager.instance.composePrices["SKILL" + RareType.SERVER_CHARACTER[originalData.rare]];
                break;

            case Type.Unit:
                slotSource.setData(UIChallengeItemSlot.Type.Unit, source);
                price = GameDataManager.instance.composePrices["UNIT" + RareType.SERVER_CHARACTER[originalData.rare]];
                break;
            }

            slotResult.gameObject.SetActive(true);
            slotResult.setRare(originalData.rare + 1);
            slotResult.setLevel(1);
            slotResult.spBackground.gameObject.SetActive(true);
            slotResult.spBackground.spriteName = UIHeroInventorySlot.SLOT_BG_QUESTION;


            btnCompose.isEnabled = true;
            lbPrice.text         = Util.GetCommaScore(price);
            _currentComposePrice = price;
            return(1);
        }
        else if (slotIndex == sourceIndex)
        {
            sourceIndex = -999;
            source      = null;

            slotSource.infoData = null;
            slotSource.gameObject.SetActive(false);
            slotResult.gameObject.SetActive(false);

            btnCompose.isEnabled = false;
            lbPrice.text         = "0";
            return(-1);
        }
        return(0);
    }
Beispiel #2
0
    public void setData(string original, string source)
    {
        GameIDData originalData = new GameIDData();
        GameIDData slotData     = new GameIDData();

        originalData.parse(original);
        slotData.parse(source);

        slotOriginal.setData(original);
        slotSource.setData(source);

        slotSource.setData(UIChallengeItemSlot.Type.Unit, slotData);
        int price = GameDataManager.instance.composePrices["UNIT" + RareType.SERVER_CHARACTER[originalData.rare]];

        slotResult.gameObject.SetActive(true);
        slotResult.setRare(originalData.rare + 1);
        slotResult.setLevel(1);
        slotResult.spBackground.gameObject.SetActive(true);
        slotResult.spBackground.spriteName = UIHeroInventorySlot.SLOT_BG_QUESTION;

        lbPrice.text = Util.GetCommaScore(price);
    }