Ejemplo n.º 1
0
    public void ShowSkillData(SkillTemplate skillT, ObjectCard card, int index)
    {
        m_Index    = index;
        m_Card     = card;
        m_SkillT   = skillT;
        m_skillUpT = (SkillupcostTemplate)DataTemplate.GetInstance().m_SkillupcostTable.getTableData(skillT.getId());

        ShowSkillText();
        ShowSkillLevel();
        ShowSkillConsUI();
        m_SkillUnlockTxt.text = GameUtils.GetSkillColorClear(index);
    }
Ejemplo n.º 2
0
    private bool CheckSkillUpgrade(ObjectCard hero)
    {
        if (hero == null)
        {
            return(false);
        }

        bool         _result       = false;
        HeroTemplate _heroTemplate = hero.GetHeroRow();
        int          _heroQuality  = _heroTemplate.getQuality();

        SpellData[] SkillDataList = hero.GetHeroData().SpellDataList;
        for (int i = 0; i < SkillDataList.Length; i++)
        {
            if (SkillDataList[i].SpellID < 0)
            {
                continue;
            }

            bool                _canUpgrade = false;
            int[]               _upgradeCostArr;
            int[]               _upgradeCostNumArr;
            SkillTemplate       _skill       = m_SkillTable.getTableData(SkillDataList[i].SpellID) as SkillTemplate; //_SkillData.SpellID为技能ID
            SkillupcostTemplate _skillUpCost = m_SkillupcostTable.getTableData(_skill.getId()) as SkillupcostTemplate;

            _canUpgrade = _skillUpCost.getUpgradeSkillID() > 0 && _heroQuality >= _skillUpCost.getUpgradeStarCondition();

            _upgradeCostArr    = _skillUpCost.getUpgradeCostId();
            _upgradeCostNumArr = _skillUpCost.getUpgradeCostNum();

            if (_canUpgrade)
            {
                for (int j = 0; j < _upgradeCostArr.Length; j++)
                {
                    long _upgradeResource = 0;
//                    m_ObjectSelf.TryGetResourceCountById(_upgradeCostArr[j], ref _upgradeResource);
                    _upgradeResource = ReturnItemCount(_upgradeCostArr[j]);
                    _canUpgrade     &= _upgradeCostNumArr[j] <= _upgradeResource;
                    if (!_canUpgrade)
                    {
                        break;
                    }
                }
            }
            if (_canUpgrade)
            {
                _result = _canUpgrade;
                break;
            }
        }

        return(_result);
    }
Ejemplo n.º 3
0
    public void ShowSkillPopUI(SkillTemplate skillT, ObjectCard card, int index, SkillPopUIType type = SkillPopUIType.Default)
    {
        bool isSkillOpen = card.GetHeroData().QualityLev >= index;

        m_Index    = index;
        m_Card     = card;
        m_SkillT   = skillT;
        m_SkillUpT = (SkillupcostTemplate)DataTemplate.GetInstance().m_SkillupcostTable.getTableData(m_SkillT.getId());


        switch (type)
        {
        case SkillPopUIType.Default:
            if (isSkillOpen)
            {
                SkillOpenInitUI();
            }
            else
            {
                SkillNotOpenInitUI();
            }
            break;

        case SkillPopUIType.Locked:
            SkillNotOpenInitUI();
            break;

        case SkillPopUIType.LevelUp:
            SkillLevelUpInitUI();
            break;

        case SkillPopUIType.UnLocked:
            SkillOpenInitUI();
            break;

        default:
            break;
        }

        m_SkillIconImg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + skillT.getSkillIcon());
        InterfaceControler.GetInst().ShowSkillTypeIcon(m_SkillT, m_SkillTypeImg);
        m_SkillNameTxt.text = GameUtils.getString(m_SkillT.getSkillName());
        m_SkillDesTxt.text  = GameUtils.getHeroString(m_SkillT.getSkillDes(), m_Card /*).Replace("\\n", "\n"*/);
    }