示例#1
0
    // 显示每一个英雄的数据
    public void ShowHeroData()
    {
        heroCountList.Clear();
        int[] heroID     = _artifact.GetArtifactRow().getHeroID();
        int[] heroNumber = _artifact.GetArtifactRow().getHeroNum();
        // 每一个英雄数据
        for (int i = 0; i < heroID.Length; i++)
        {
            if (heroID[i] == -1)
            {
                continue;
            }

            HeroTemplate heroData = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(heroID[i]);
            GameObject   cell     = _heroLayout.transform.GetChild(i).gameObject;
            cell.SetActive(true);
            HeroCountItem item = cell.AddComponent <HeroCountItem>();
            item.ShowInfo(heroData, _artifact, heroNumber[i], i);
            heroCountList.Add(item);
        }
    }
示例#2
0
    public void ShowInfoReach(ArtifactTemplate artifact, bool isReach = false)
    {
        _artifactName.text = GameUtils.getString(artifact.getName());

        if (isReach)
        {
            _artifactState.text = GameUtils.getString("relics_content8");
        }
        else
        {
            ArtifactTemplate temp = (ArtifactTemplate)DataTemplate.GetInstance().m_ArtifactTable.getTableData(artifact.getId() - 1);
            string           str  = GameUtils.getString("relics_content10");
            str = string.Format(str, GameUtils.getString(temp.getName()));
            _artifactState.text = str;
        }

        // 英雄 ID
        int[] heroID     = artifact.getHeroID();
        int[] heroNumber = artifact.getHeroNum();
        // 每一个英雄数据
        for (int i = 0; i < heroID.Length; i++)
        {
            if (heroID[i] == -1)
            {
                continue;
            }

            HeroTemplate heroData = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(heroID[i]);
            GameObject   cell     = _heroLayout.transform.GetChild(i).gameObject;
            cell.SetActive(true);
            HeroCountItem item = cell.AddComponent <HeroCountItem>();
            item.ShowInfo(artifact, i, isReach);
        }

        Show(artifact, isReach);
    }
示例#3
0
    public void ShowInfoLevel(Artifact artifact, int level)
    {
        if (level < 5)
        {
            _artifactState.text = GameUtils.getString("relics_content9");
        }
        else
        {
            _artifactState.text = GameUtils.getString("relics_content8");
        }

        _artifactName.text = GameUtils.getString(artifact.GetArtifactRow().getName());

        // 英雄 ID
        int[] heroID     = artifact.GetArtifactRow().getHeroID();
        int[] heroNumber = artifact.GetArtifactRow().getHeroNum();

        // 每一个英雄数据
        for (int i = 0; i < heroID.Length; i++)
        {
            if (heroID[i] == -1)
            {
                continue;
            }

            HeroTemplate heroData = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(heroID[i]);
            GameObject   cell     = _heroLayout.transform.GetChild(i).gameObject;
            cell.SetActive(true);
            HeroCountItem item = cell.AddComponent <HeroCountItem>();
            item.ShowInfo(heroData, artifact, heroNumber[i], i);
        }

        // 初始化属性数据
        int[] attrType  = artifact.GetArtifactRow().getAttriType();
        int[] attrValue = artifact.GetArtifactRow().getAttriValue();
        for (int i = 0; i < attrType.Length; i++)
        {
            if (attrType[i] == -1)
            {
                continue;
            }

            _attributeList.transform.GetChild(i).gameObject.SetActive(true);
            Text attrNameText  = _attributeList.transform.GetChild(i).FindChild("AttrName").GetComponent <Text>();
            Text attrValueText = _attributeList.transform.GetChild(i).FindChild("AttrValue").GetComponent <Text>();
            Text attrStateText = _attributeList.transform.GetChild(i).FindChild("AttrState").GetComponent <Text>();
            attrStateText.color = new Color(133.0f / 255, 247.0f / 255, 32.0f / 255);
            switch (attrType[i])
            {
            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_MAXHP:
            {
                // 生命值
                attrNameText.text  = GameUtils.getString("baseattribute1des");
                attrValueText.text = artifact.GetCurHP().ToString();
                if (artifact.GetCurHP() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_PHYSICALATTACK:
            {
                // 物攻
                attrNameText.text  = GameUtils.getString("hero_train_type2");
                attrValueText.text = artifact.GetCurPhysicalAttack().ToString();
                if (artifact.GetCurPhysicalAttack() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_PHYSICALDEFENCE:
            {
                // 物防
                attrNameText.text  = GameUtils.getString("hero_train_type4");
                attrValueText.text = artifact.GetCurPhysicalDefence().ToString();
                if (artifact.GetCurPhysicalDefence() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_MAGICATTACK:
            {
                // 法攻
                attrNameText.text  = GameUtils.getString("hero_train_type3");
                attrValueText.text = artifact.GetCurMagicAttack().ToString();
                if (artifact.GetCurMagicAttack() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_MAGICDEFENCE:
            {
                // 法防
                attrNameText.text  = GameUtils.getString("hero_train_type5");
                attrValueText.text = artifact.GetCurMagicDefence().ToString();
                if (artifact.GetCurMagicDefence() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_HIT:
            {
                // 命中
                attrNameText.text  = GameUtils.getString("baseattribute6des");
                attrValueText.text = artifact.GetCurHit().ToString();
                if (artifact.GetCurHit() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_DODGE:
            {
                // 闪避
                attrNameText.text  = GameUtils.getString("baseattribute7des");
                attrValueText.text = artifact.GetCurDodge().ToString();
                if (artifact.GetCurDodge() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_CRITICAL:
            {
                // 暴击
                attrNameText.text  = GameUtils.getString("baseattribute8des");
                attrValueText.text = artifact.GetCurCritical().ToString();
                if (artifact.GetCurCritical() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_TENACITY:
            {
                // 韧性
                attrNameText.text  = GameUtils.getString("baseattribute9des");
                attrValueText.text = artifact.GetCurTenacity().ToString();
                if (artifact.GetCurTenacity() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
            }
            break;

            default:
                break;
            }
        }
    }
示例#4
0
    // 显示神器 Item 的所有属性,在神器界面调用
    public void ShowInfo(Artifact artifact)
    {
        _artifact      = artifact;
        _tipsText.text = GameUtils.getString("relics_content1");

        if (artifact.GetArtifactDB().GetLevel() == 5)
        {
            bool  ret     = false;
            int[] recode  = artifact.GetArtifactDB().m_IntoRecord;
            int[] heroNum = artifact.GetArtifactRow().getHeroNum();
            for (int i = 0; i < heroNum.Length; i++)
            {
                if (heroNum[i] > recode[i])
                {
                    ret = true;
                    break;
                }
            }

            if (ret)
            {
                _tipsText.text = GameUtils.getString("relics_content14");
            }
            else
            {
                _tipsText.text = GameUtils.getString("relics_content15");
            }
        }

        _atrifactName.text = GameUtils.getString(_artifact.GetArtifactRow().getName());
        int level             = _artifact.GetArtifactRow().getLevel();
        ArtifactTemplate temp = (ArtifactTemplate)DataTemplate.GetInstance().m_ArtifactTable.getTableData(_artifact.GetArtifactRow().GetID() + 1);

        if (level < 5)
        {
            _nextName.text = GameUtils.getString(temp.getName());
        }
        else
        {
            _nextName.gameObject.SetActive(false);
        }

        // 英雄 ID
        int[] heroID     = artifact.GetArtifactRow().getHeroID();
        int[] heroNumber = artifact.GetArtifactRow().getHeroNum();

        // 每一个英雄数据
        for (int i = 0; i < heroID.Length; i++)
        {
            if (heroID[i] == -1)
            {
                continue;
            }

            HeroTemplate heroData = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(heroID[i]);
            GameObject   cell     = _heroLayout.transform.GetChild(i).gameObject;
            cell.SetActive(true);
            HeroCountItem item = cell.GetComponent <HeroCountItem>();
            if (item == null)
            {
                item = cell.AddComponent <HeroCountItem>();
            }
            item.ShowInfo(heroData, artifact, heroNumber[i], i);
            heroCountList.Add(item);
        }

        // 神器头像
        _artImage.sprite = UIResourceMgr.LoadSprite(common.defaultPath + temp.getResourceName());
        _artImage.SetNativeSize();

        // 初始化属性数据
        int[] attrType  = artifact.GetArtifactRow().getAttriType();
        int[] attrValue = artifact.GetArtifactRow().getAttriValue();
        for (int i = 0; i < attrType.Length; i++)
        {
            if (attrType[i] == -1)
            {
                continue;
            }

            _attributeList.transform.GetChild(i).gameObject.SetActive(true);
            Text attrNameText  = _attributeList.transform.GetChild(i).FindChild("AttrName").GetComponent <Text>();
            Text attrValueText = _attributeList.transform.GetChild(i).FindChild("AttrValue").GetComponent <Text>();
            Text attrStateText = _attributeList.transform.GetChild(i).FindChild("AttrState").GetComponent <Text>();
            attrStateText.color = new Color(133.0f / 255, 247.0f / 255, 32.0f / 255);
            switch (attrType[i])
            {
            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_MAXHP:
            {
                // 生命值
                attrNameText.text  = GameUtils.getString("baseattribute1des");
                attrValueText.text = artifact.GetCurHP().ToString();
                if (artifact.GetCurHP() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
                else
                {
                    attrStateText.text = GameUtils.getString("relics_content6");
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_PHYSICALATTACK:
            {
                // 物攻
                attrNameText.text  = GameUtils.getString("hero_train_type2");
                attrValueText.text = artifact.GetCurPhysicalAttack().ToString();
                if (artifact.GetCurPhysicalAttack() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
                else
                {
                    attrStateText.text = GameUtils.getString("relics_content6");
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_PHYSICALDEFENCE:
            {
                // 物防
                attrNameText.text  = GameUtils.getString("hero_train_type4");
                attrValueText.text = artifact.GetCurPhysicalDefence().ToString();
                if (artifact.GetCurPhysicalDefence() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
                else
                {
                    attrStateText.text = GameUtils.getString("relics_content6");
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_MAGICATTACK:
            {
                // 法攻
                attrNameText.text  = GameUtils.getString("hero_train_type3");
                attrValueText.text = artifact.GetCurMagicAttack().ToString();
                if (artifact.GetCurMagicAttack() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
                else
                {
                    attrStateText.text = GameUtils.getString("relics_content6");
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_MAGICDEFENCE:
            {
                // 法防
                attrNameText.text  = GameUtils.getString("hero_train_type5");
                attrValueText.text = artifact.GetCurMagicDefence().ToString();
                if (artifact.GetCurMagicDefence() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
                else
                {
                    attrStateText.text = GameUtils.getString("relics_content6");
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_HIT:
            {
                // 命中
                attrNameText.text  = GameUtils.getString("baseattribute6des");
                attrValueText.text = artifact.GetCurHit().ToString();
                if (artifact.GetCurHit() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
                else
                {
                    attrStateText.text = GameUtils.getString("relics_content6");
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_DODGE:
            {
                // 闪避
                attrNameText.text  = GameUtils.getString("baseattribute7des");
                attrValueText.text = artifact.GetCurDodge().ToString();
                if (artifact.GetCurDodge() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
                else
                {
                    attrStateText.text = GameUtils.getString("relics_content6");
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_CRITICAL:
            {
                // 暴击
                attrNameText.text  = GameUtils.getString("baseattribute8des");
                attrValueText.text = artifact.GetCurCritical().ToString();
                if (artifact.GetCurCritical() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
                else
                {
                    attrStateText.text = GameUtils.getString("relics_content6");
                }
            }
            break;

            case (int)EM_EXTEND_ATTRIBUTE.EM_EXTEND_ATTRIBUTE_POINT_TENACITY:
            {
                // 韧性
                attrNameText.text  = GameUtils.getString("baseattribute9des");
                attrValueText.text = artifact.GetCurTenacity().ToString();
                if (artifact.GetCurTenacity() < attrValue[i])
                {
                    string str = GameUtils.getString("relics_content5");
                    attrStateText.text = string.Format(str, attrValue[i].ToString());
                }
                else
                {
                    attrStateText.text = GameUtils.getString("relics_content6");
                }
            }
            break;

            default:
                break;
            }
        }
    }