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 show(Rune.Type type, string sourceId, int didLoad)
    {
        _type     = type;
        _didLoad  = didLoad;
        _sourceId = sourceId;

        itemslot.setData(sourceId);
        show();
    }
    public void start(Type type, string id, int targetIndex)
    {
//		Debug.LogError("start : " + targetIndex);
        _type        = type;
        _targetIndex = targetIndex;
        slot.setData(id);
        ani.Rewind();
        ani.Play();
    }
    public void startFromSummon(GameIDData originalItemData, int slotIndex)
    {
        _type = Type.Unit;

//		isTabSlot = !originalSlot.isInventorySlot;

        lbDefaultMessage.text = Util.getUIText("COMPOSE_UNIT");

        GameManager.me.uiManager.uiMenu.uiSummon.btnSort.gameObject.SetActive(false);

        originalSlotIndex = slotIndex;
        originalData      = new GameIDData();
        originalData.parse(originalItemData.serverId, originalItemData.type);

        isTabSlot = (slotIndex < 0);

        slotOriginal.setData(UIChallengeItemSlot.Type.Unit, originalData);

        init();

        GameManager.me.uiManager.uiMenu.uiSummon.invenList.draw(false);
    }
Beispiel #5
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);
    }
Beispiel #6
0
    public void setData(RoundClearLevelupItemData data)
    {
        itemData = data;

        itemSlot.setData(data.id);

        particleLevelup.gameObject.SetActive(false);

        if (data.plusLevel > 0)
        {
            spOldExpPer.fillAmount = 0;
            lbPlusLevel.text       = data.plusLevel.ToString();
            lbPlusLevel.cachedGameObject.SetActive(true);
            spLevelup.enabled = true;
        }
        else
        {
            lbPlusLevel.cachedGameObject.SetActive(false);
            spOldExpPer.fillAmount = data.oldPercent;
            spLevelup.enabled      = false;
        }

        if (itemSlot.infoData.level >= 20)
        {
            if (data.plusLevel == 0)
            {
                spNewExpPer.fillAmount = 0;
                spOldExpPer.fillAmount = 1;
            }
            else
            {
                spNewExpPer.fillAmount = 1.0f;
            }
        }
        else
        {
            spNewExpPer.fillAmount = itemSlot.infoData.getReinforceProgressPercent();
        }
    }