//设置属性面板显示
    void SetCardPropPanel(CSItem card)
    {
        //升段前属性
        int beaforLevel    = card.Level;         //当前等级
        int beaforMaxLevel = card.GetMaxLevel(); //最大等级

        m_danBefor.transform.Find("LevelTips").GetComponent <UILabel>().text = beaforLevel.ToString() + '/' + beaforMaxLevel.ToString();

        GradeUpRequireInfo gradeInfo = GameTable.gradeUpRequireAsset.Lookup(card.m_id);

        if (null == gradeInfo)
        {
            return;
        }
        int beaforBreak = card.BreakCounts;      //当前突破次数
        int maxBreak    = gradeInfo.GradeUpTime; //最大突破次数

        m_danBefor.transform.Find("Dan").GetComponent <UILabel>().text = beaforBreak.ToString() + '/' + maxBreak.ToString();

        int beaforHp = card.GetHp();//当前生命值

        m_danBefor.transform.Find("HP").GetComponent <UILabel>().text = beaforHp.ToString();

        int beaforAttack = card.GetPhyAttack();//物理攻击力

        m_danBefor.transform.Find("Attack").GetComponent <UILabel>().text = beaforAttack.ToString();

        int beaforMagAtt = card.GetMagAttack();//魔法攻击力

        m_danBefor.transform.Find("MagAttack").GetComponent <UILabel>().text = beaforMagAtt.ToString();

        //升段后属性
        int afterLevel    = card.Level;                                  //升级后等级
        int afterMaxLevel = card.GetMaxLevel() + gradeInfo.LevelLimitUp; //最大等级

        m_danAfter.transform.Find("LevelTips").GetComponent <UILabel>().text = afterLevel.ToString() + '/' + afterMaxLevel.ToString();

        int afterBreak = card.BreakCounts + 1;//当前突破次数

        m_danAfter.transform.Find("Dan").GetComponent <UILabel>().text = afterBreak.ToString() + '/' + maxBreak.ToString();

        int afterHp = card.GetHp() + gradeInfo.HpUp;//升级后生命值

        m_danAfter.transform.Find("HP").GetComponent <UILabel>().text = afterHp.ToString() + "(+" + gradeInfo.HpUp.ToString() + ')';

        int afterAttack = card.GetPhyAttack() + gradeInfo.AttackUp;//升级后攻击力

        m_danAfter.transform.Find("Attack").GetComponent <UILabel>().text = afterAttack.ToString() + "(+" + gradeInfo.AttackUp.ToString() + ')';

        int afterMagAtt = card.GetMagAttack() + gradeInfo.MagicAttackUp;//升级后攻击力

        m_danAfter.transform.Find("MagAttack").GetComponent <UILabel>().text = afterMagAtt.ToString() + "(+" + gradeInfo.MagicAttackUp.ToString() + ')';
    }
Example #2
0
    void ShowBattleHelper(int userGUID)
    {
        Helper helper = User.Singleton.HelperList.LookupHelper(userGUID);

        if (helper == null)
        {
            Debug.Log("No this helper, id = " + userGUID.ToString());
            ShowSelf();
            return;
        }
        m_btnTeamLeaderModel.SetActive(false);
        m_btnCancelTeamLeaderMode.SetActive(false);
        m_btnSelectThis.SetActive(true);
        m_btnChangeCard.SetActive(false);
        //userinfo
        m_userName.text  = helper.m_userName;
        m_userLevel.text = Localization.Get("CardLevel") + helper.m_userLevel.ToString();
        m_labelGUID.text = "ID:" + helper.m_userGuid.ToString();

        CSItem card = new CSItem();

        card.Guid        = helper.m_cardGuid;
        card.m_id        = (short)helper.m_cardId;
        card.Level       = helper.m_cardLevel;
        card.BreakCounts = helper.m_cardBreakCounts;
        card.m_segment.m_heroCard.m_skill = helper.m_cardSkill;

        //代表卡info
//      CSItemGuid cardGuid = User.Singleton.RepresentativeCard;
//      CSItem card = CardBag.Singleton.GetCardByGuid(cardGuid);
        if (card != null)
        {
            Debug.Log("RefreshInfo");
            HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);
            if (info == null)
            {
                return;
            }
            int            headImageID = info.headImageId;
            IconInfomation icon        = GameTable.IconInfoTableAsset.Lookup(headImageID);
            m_cardPortrait.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);

            m_cardName.text  = info.StrName;
            m_cardLevel.text = card.Level.ToString();
            RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity);
            icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId);
            m_raritySprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);
            int    occ      = info.Occupation;
            int    race     = info.Type;
            string occName  = GameTable.OccupationInfoAsset.LookUp(occ).m_name;
            string raceName = GameTable.RaceInfoTableAsset.LookUp(race).m_name;
            m_occAndRace.text        = occName + " " + raceName;
            m_phyAttack.text         = ((int)card.GetPhyAttack()).ToString();
            m_magAttack.text         = ((int)card.GetMagAttack()).ToString();
            m_hp.text                = ((int)card.GetHp()).ToString();
            m_breakthroughTimes.text = card.BreakCounts.ToString();
        }
    }
Example #3
0
    // 更新 强化成功信息 并显示出来
    void UpdateSuccessInfo()
    {
        m_success.gameObject.SetActive(true);

        CSItem card = CardBag.Singleton.GetCardByGuid(CardUpdateProp.Singleton.m_levelUpAfterGuid);

        if (null == card)
        {
            return;
        }

        HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);

        if (null == info)
        {
            return;
        }

        IconInfomation imageInfo = GameTable.IconInfoTableAsset.Lookup(info.ImageId);

        if (null == imageInfo)
        {
            return;
        }

        // 突破次数
        int breakNum = card.BreakCounts - CardUpdateProp.Singleton.m_oldBreak;

        if (breakNum > 0)
        {
            m_successBreak.text = string.Format(Localization.Get("BreakNum"), breakNum);
        }
        else
        {
            m_successBreak.text = "";
        }

        m_successCardBG.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName);

        // 升级前的数据
        m_oldLv.text        = CardUpdateProp.Singleton.m_oldLevelTips;
        m_oldHp.text        = "" + CardUpdateProp.Singleton.m_oldHP;
        m_oldMagAttack.text = "" + CardUpdateProp.Singleton.m_oldMagAtk;
        m_oldPhyAttack.text = "" + CardUpdateProp.Singleton.m_oldPhyAtk;

        // 升级后的数据
        m_newLv.text        = card.Level + "/" + card.GetMaxLevel();
        m_newHp.text        = "" + (int)card.GetHp();
        m_newMagAttack.text = "" + card.GetMagAttack();
        m_newPhyAttack.text = "" + card.GetPhyAttack();
    }
Example #4
0
    // 更新卡牌界面相关信息 
    public void UpdateInfo(CSItemGuid guid)
    {
        CSItem card = CardBag.Singleton.GetCardByGuid(guid);
        if (null == card)
        {
            return;
        }
        
        m_name.text         = "";

        HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);
        if (null == info)
        {
            Debug.Log("UICard UpdateInfo HeroInfo 表数据没有 ID 为:" + card.IDInTable);
            return;
        }

        IconInfomation imageInfo  = GameTable.IconInfoTableAsset.Lookup(info.ImageId);

        if (null == imageInfo)
        {
            return;
        }

        m_card.mainTexture = PoolManager.Singleton.LoadIcon<Texture>(imageInfo.dirName);

        m_name.text             = info.StrName;
        m_attirbutename.name    = info.StrName;

        // 星级

        RarityRelativeInfo rarityInfo   = GameTable.RarityRelativeAsset.LookUp(info.Rarity);
        if (null == rarityInfo)
        {
            return;
        }
        IconInfomation icon             = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId);
        m_cardRarity.GetComponent<UITexture>().mainTexture = PoolManager.Singleton.LoadIcon<Texture>(icon.dirName);

        // 消耗
        m_cardCost.text     = info.Cost.ToString();

        // 生命值
        m_cardHp.text       = card.GetHp().ToString();

        m_magAttack.text    = card.GetMagAttack().ToString();

        m_cardAttack.text   = card.GetPhyAttack().ToString();
    }
Example #5
0
    // 设置升级前的 老数据
    public void SetOldData()
    {
        CSItem card = CardBag.Singleton.GetCardByGuid(m_curLevelGuid);

        if (null == card)
        {
            return;
        }

        m_oldLevel     = card.Level;
        m_oldLevelTips = card.Level + "/" + card.GetMaxLevel();
        m_oldHP        = card.GetHp();
        m_oldBreak     = card.BreakCounts;
        m_oldMagAtk    = card.GetMagAttack();
        m_oldPhyAtk    = card.GetPhyAttack();
        // 记录 技能相关信息
        SetOldSkillData();
    }
Example #6
0
    void ShowSelf()
    {
        m_btnTeamLeaderModel.SetActive(User.Singleton.IsTeamLeaderModel);
        m_btnCancelTeamLeaderMode.SetActive(!User.Singleton.IsTeamLeaderModel);
        m_btnSelectThis.SetActive(false);
        m_btnChangeCard.SetActive(true);

        //userinfo
        m_userName.text  = User.Singleton.UserProps.GetProperty_String(UserProperty.name);
        m_userLevel.text = Localization.Get("CardLevel") + User.Singleton.UserProps.GetProperty_Int32(UserProperty.level).ToString();
        m_labelGUID.text = "ID:" + User.Singleton.Guid.ToString();

        //代表卡info
        CSItemGuid cardGuid = User.Singleton.RepresentativeCard;
        CSItem     card     = CardBag.Singleton.GetCardByGuid(cardGuid);

        if (card != null)
        {
            Debug.Log("RefreshInfo");
            HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);
            if (info == null)
            {
                return;
            }
            int            headImageID = info.headImageId;
            IconInfomation icon        = GameTable.IconInfoTableAsset.Lookup(headImageID);
            m_cardPortrait.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);
            m_cardName.text            = info.StrName;
            m_cardLevel.text           = card.Level.ToString();

            RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity);
            icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId);
            m_raritySprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);
            int    occ      = info.Occupation;
            int    race     = info.Type;
            string occName  = GameTable.OccupationInfoAsset.LookUp(occ).m_name;
            string raceName = GameTable.RaceInfoTableAsset.LookUp(race).m_name;
            m_occAndRace.text        = occName + " " + raceName;
            m_phyAttack.text         = ((int)card.GetPhyAttack()).ToString();
            m_magAttack.text         = ((int)card.GetMagAttack()).ToString();
            m_hp.text                = ((int)card.GetHp()).ToString();
            m_breakthroughTimes.text = card.BreakCounts.ToString();
        }
    }
Example #7
0
    public void ShowFriendPlayerInfo(FriendItem friendItem)
    {
        m_btnTeamLeaderModel.SetActive(false);
        m_btnCancelTeamLeaderMode.SetActive(false);

        FindChild("FriendBtnList").SetActive(true);
        FindChild("RepresentativeBtnList").SetActive(false);
        m_frienditem     = friendItem;
        m_userName.text  = friendItem.m_actorName;
        m_userLevel.text = Localization.Get("CardLevel") + friendItem.m_level;
        m_labelGUID.text = "ID:" + "000000";
        CSItem card = friendItem.GetItem();

        if (card != null)
        {
            Debug.Log("RefreshInfo");
            HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);
            if (info == null)
            {
                return;
            }
            int            headImageID = info.headImageId;
            IconInfomation icon        = GameTable.IconInfoTableAsset.Lookup(headImageID);
            m_cardPortrait.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);
            m_cardName.text            = info.StrName;
            m_cardLevel.text           = card.Level.ToString();

            RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity);
            icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId);
            m_raritySprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);

            int    occ      = info.Occupation;
            int    race     = info.Type;
            string occName  = GameTable.OccupationInfoAsset.LookUp(occ).m_name;
            string raceName = GameTable.RaceInfoTableAsset.LookUp(race).m_name;
            m_occAndRace.text        = occName + " " + raceName;
            m_phyAttack.text         = ((int)card.GetPhyAttack()).ToString();
            m_magAttack.text         = ((int)card.GetMagAttack()).ToString();
            m_hp.text                = ((int)card.GetHp()).ToString();
            m_breakthroughTimes.text = card.BreakCounts.ToString();
        }
        ShowWindow();
    }
Example #8
0
    public float GetSortValue(CSItem item, ENSortType sortType, out Dictionary <float, List <CSItem> > dicTeam, out List <float> tempTeam)
    {
        tempTeam = new List <float>();
        dicTeam  = new Dictionary <float, List <CSItem> >();
        float propVal = 0f;

        switch (sortType)
        {
        case ENSortType.enByPhyAttack:
            propVal = item.GetPhyAttack();
            break;

        case ENSortType.enByMagAttack:
            propVal = item.GetMagAttack();
            break;

        case ENSortType.enByHp:
            propVal = item.GetHp();
            break;

        default:
            UnityEngine.Debug.Log("SortByProperty err, type = " + sortType);
            break;
            // return 0;
        }
        if (Team.Singleton.IsCardInTeam(item.Guid))
        {
            if (dicTeam.ContainsKey(propVal))
            {
                dicTeam[propVal].Add(item);
            }
            else
            {
                List <CSItem> tmpItemList = new List <CSItem>();
                tmpItemList.Add(item);
                dicTeam.Add(propVal, tmpItemList);
                tempTeam.Add(propVal);
            }
        }
        return(propVal);
    }
    void ShowRepresentativeCardInfo(CSItemGuid guid)
    {
        m_RCOption.SetActive(true);

        CSItem card = CardBag.Singleton.GetCardByGuid(guid);

        HeroInfo hero = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);

        if (null == hero)
        {
            Debug.LogWarning("null == hero card.IDInTable:" + card.IDInTable);
            return;
        }

        IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(hero.ImageId);

        RaceInfo race = GameTable.RaceInfoTableAsset.LookUp(hero.Type);

        OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(hero.Occupation);

        // 图片
        FindChildComponent <UITexture>("CardPic", m_RCOption).mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);
        GameObject info = FindChild("Info", m_RCOption);

        FindChildComponent <UILabel>("InfoName", info).text      = hero.StrName;
        FindChildComponent <UILabel>("InfoLevel", info).text     = Localization.Get("CardLevel") + card.Level;
        FindChildComponent <UILabel>("InfoOp", info).text        = occupationInfo.m_name;
        FindChildComponent <UILabel>("InfoHp", info).text        = card.GetHp().ToString();
        FindChildComponent <UILabel>("InfoMagAttack", info).text = card.GetMagAttack().ToString();
        FindChildComponent <UILabel>("InfoPhyAttack", info).text = card.GetPhyAttack().ToString();
        FindChildComponent <UILabel>("InfoRace", info).text      = race.m_name;


        RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(hero.Rarity);

        icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId);
        FindChildComponent <UITexture>("InfoRank", info).mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);
    }
Example #10
0
    // 更新信息
    void UpdateInfo()
    {
        CSItem card = CardBag.Singleton.m_cardForDetail;

        if (null == card)
        {
            return;
        }

        // 如果卡牌ID为0则 是用预览卡牌(不是背包里的卡牌) 此时 加到最爱 进化 强化等按钮不显示
        if (CardBag.Singleton.m_curOptinGuid.Equals(CSItemGuid.Zero))
        {
            m_levelUpBtn.gameObject.SetActive(false);

            m_evolutionBtn.gameObject.SetActive(false);

            m_breachBtn.gameObject.SetActive(false);
        }
        else
        {
            m_levelUpBtn.gameObject.SetActive(card.IsStengthen());

            m_evolutionBtn.gameObject.SetActive(card.IsEvlotion());

            m_breachBtn.gameObject.SetActive(true);
        }
        m_grid.Reposition();
        AddModel(card, m_model);
        HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);

        if (null == heroInfo)
        {
            Debug.LogWarning("heroInfo == NULL heroInfo cardID:" + card.IDInTable);
            return;
        }

        m_cardPanel.Update(card.IDInTable);

        IconInfomation iconInfo       = GameTable.IconInfoTableAsset.Lookup(heroInfo.ImageId);
        OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation);
        RaceInfo       raceInfo       = GameTable.RaceInfoTableAsset.LookUp(heroInfo.Type);

//        LevelUpInfo levelupInfo         = GameTable.LevelUpTableAsset.LookUp(card.Level);
        m_cost.text       = "" + heroInfo.Cost;
        m_phyAttack.text  = "" + (int)card.GetPhyAttack();
        m_magAttack.text  = "" + (int)card.GetMagAttack();
        m_hp.text         = "" + (int)card.GetHp();
        m_occupation.text = occupationInfo.m_name;
        m_type.text       = raceInfo.m_name;
        m_curLevel.text   = "" + card.Level;
        m_maxLevel.GetComponent <UILabel>().text = card.GetMaxLevel().ToString();

        IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId);

        m_occTexture.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);
        icon = GameTable.IconInfoTableAsset.Lookup(raceInfo.m_iconId);
        m_raceTexture.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);

        // 段位升级
        UpdateDanData(card.BreakCounts);

        foreach (UICardDetailSkillItem item in m_skillList)
        {
            if (null != item)
            {
                item.HideWindow();
            }
        }

        foreach (UICardDetailSkillItem item in m_passvieSkillList)
        {
            if (null != item)
            {
                item.HideWindow();
            }
        }

        int        i           = 0;
        List <int> skillIDList = heroInfo.GetAllSkillIDList();

        foreach (int skillId in skillIDList)
        {
            if (0 != heroInfo.NormalSkillIDList.Find(item => item == skillId))
            {
                continue;
            }
            SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(skillId);
            if (null == skillInfo)
            {
                continue;
            }

            // 普通技能才被列入
            if (skillInfo.SkillType != 0)
            {
                continue;
            }
            iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon);

            if (null == iconInfo)
            {
                continue;
            }
            if (i < m_skillList.Length)
            {
                UICardDetailSkillItem item = m_skillList[i];
                if (null == item)
                {
                    item           = UICardDetailSkillItem.Create();
                    m_skillList[i] = item;
                    item.SetParent(m_skillParent.transform);
                    item.SetPressCallbacked(OnShowTips);
                    item.SetClickCallbacked(OnHideTips);
                }

                item.ShowWindow();
                item.Update(skillId);
                i++;
            }
        }

        m_skillParent.GetComponent <UIGrid>().Reposition();

        i = 0;
        bool bNone = true;

        foreach (int skillId in heroInfo.PassiveSkillIDList)
        {
            SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(skillId);
            if (null == skillInfo)
            {
                continue;
            }
            iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon);
            if (null == iconInfo)
            {
                continue;
            }
            if (i >= m_passvieSkillList.Length)
            {
                continue;
            }

            bNone = false;

            UICardDetailSkillItem item = m_passvieSkillList[i];
            if (null == item)
            {
                item = UICardDetailSkillItem.Create();
                m_passvieSkillList[i] = item;
                item.SetParent(m_passiveSkillParent.transform);

                item.SetPressCallbacked(OnShowTips);
                item.SetClickCallbacked(OnHideTips);
            }

            item.ShowWindow();
            item.Update(skillId);
            i++;
        }

        m_passiveSkillParent.GetComponent <UIGrid>().Reposition();
        m_skillNoneLabel.gameObject.SetActive(bNone);
    }
Example #11
0
    //设置属性面板显示
    void SetCardPropPanel(CSItem card)
    {
        //进阶前属性
        int beaforLevel    = card.Level;         //当前等级
        int beaforMaxLevel = card.GetMaxLevel(); //最大等级

        m_evolutionBefore.transform.Find("LevelTips").GetComponent <UILabel>().text = beaforLevel.ToString() + '/' + beaforMaxLevel.ToString();
        int beaforHp = card.GetHp();//当前生命值

        m_evolutionBefore.transform.Find("HP").GetComponent <UILabel>().text = beaforHp.ToString();

        int beaforAttack = card.GetPhyAttack();//物理攻击力

        m_evolutionBefore.transform.Find("Attack").GetComponent <UILabel>().text = beaforAttack.ToString();

        int beaforMagAtt = card.GetMagAttack();//魔法攻击力

        m_evolutionBefore.transform.Find("MagAttack").GetComponent <UILabel>().text = beaforMagAtt.ToString();

        HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);

        if (null == info)
        {
            Debug.Log("UICardEvolution HeroInfo == null card.m_id:" + card.IDInTable);
            return;
        }

        HeroInfo afterInfo = GameTable.HeroInfoTableAsset.Lookup(info.EvolveChangeID);

        if (null == afterInfo)
        {
            Debug.Log("UICardEvolution afterInfo == null card.m_id:" + info.EvolveChangeID);
            return;
        }
        //进阶后属性

        int afterLevel    = 1;                                       //升级后等级
        int afterMaxLevel = card.GetMaxLevel() + afterInfo.MaxLevel; //最大等级

        m_evolutionAfter.transform.Find("LevelTips").GetComponent <UILabel>().text  = afterLevel.ToString() + '/' + afterMaxLevel.ToString();
        m_evolutionAfter.transform.Find("LevelTips").GetComponent <UILabel>().color = Color.red;

        int afterHp = (int)afterInfo.FHPMax;//升级后生命值

        m_evolutionAfter.transform.Find("HP").GetComponent <UILabel>().text = afterHp.ToString();
        if (afterHp > beaforHp)
        {
            m_evolutionAfter.transform.Find("HP").GetComponent <UILabel>().color = Color.green;
        }
        else
        {
            m_evolutionAfter.transform.Find("HP").GetComponent <UILabel>().color = Color.red;
        }

        int afterAttack = (int)afterInfo.FPhyAttack;//升级后攻击力

        m_evolutionAfter.transform.Find("Attack").GetComponent <UILabel>().text = afterAttack.ToString();
        if (afterAttack > beaforAttack)
        {
            m_evolutionAfter.transform.Find("Attack").GetComponent <UILabel>().color = Color.green;
        }
        else
        {
            m_evolutionAfter.transform.Find("Attack").GetComponent <UILabel>().color = Color.red;
        }

        int afterMagAtt = (int)afterInfo.FMagAttack;//升级后攻击力

        m_evolutionAfter.transform.Find("MagAttack").GetComponent <UILabel>().text = afterMagAtt.ToString();
        if (afterMagAtt > beaforMagAtt)
        {
            m_evolutionAfter.transform.Find("MagAttack").GetComponent <UILabel>().color = Color.green;
        }
        else
        {
            m_evolutionAfter.transform.Find("MagAttack").GetComponent <UILabel>().color = Color.red;
        }
    }
Example #12
0
    // 卡牌上的详细信息更新
    void UpdateCardInfo()
    {
        // 清空
        if (CardUpdateProp.Singleton.m_curLevelGuid.Equals(CSItemGuid.Zero))
        {
            m_cost.text          = "";
            m_name.text          = "";
            m_phyAttack.text     = "";
            m_magAttack.text     = "";
            m_hp.text            = "";
            m_occuption.text     = "";
            m_type.text          = "";
            m_rarity.mainTexture = null;
            m_levelTips.text     = "";

            // 清空下
            m_cardBG.mainTexture = null;
            // 隐藏突破信息
            m_break.gameObject.SetActive(false);
            // 隐藏提示信息
            m_warning.gameObject.SetActive(false);

            // 隐藏 等级进度条
            m_levelBefore.gameObject.SetActive(false);
            // 隐藏 升级后的进度条
            m_levelAfter.gameObject.SetActive(false);

            m_attribute.gameObject.SetActive(false);
        }
        CSItem card = CardBag.Singleton.GetCardByGuid(CardUpdateProp.Singleton.m_curLevelGuid);

        if (null == card)
        {
            return;
        }

        HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);

        if (null == heroInfo)
        {
            return;
        }
        OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation);

        RaceInfo raceInfo = GameTable.RaceInfoTableAsset.LookUp(heroInfo.Type);

        m_cost.text      = "" + heroInfo.Cost;
        m_name.text      = heroInfo.StrName;
        m_phyAttack.text = "" + card.GetPhyAttack();
        m_magAttack.text = "" + card.GetMagAttack();
        m_hp.text        = "" + card.GetHp();
        m_occuption.text = occupationInfo.m_name;
        m_type.text      = raceInfo.m_name;

        m_levelTips.text = "" + card.Level;

        RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(heroInfo.Rarity);
        IconInfomation     icon       = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId);

        m_rarity.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);
        m_attribute.gameObject.SetActive(true);
    }
Example #13
0
    public void Update(CSItem card, ENSortType sortType, int index = 0)
    {
        if (null == card)
        {
            return;
        }

        ShowWindow();

        m_index = index;     // 表示 用显示卡牌详情
        int cardID = card.IDInTable;

        m_bg.gameObject.SetActive(true);

        HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(cardID);

        if (heroInfo != null)
        {
            // 道具ID
            m_param.m_guid = card.Guid;

            // 头像
            IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(heroInfo.headImageId);
            if (null != iconInfo)
            {
                m_headImage.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName);
            }

            // 等级
            m_level.gameObject.SetActive(true);

            // 排序后的 应显示的 属性
            switch (sortType)
            {
            case ENSortType.enByRarity:
            {
                m_level.text = heroInfo.Rarity.ToString();
                break;
            }

            case ENSortType.enByPhyAttack:
            {
                m_level.text = card.GetPhyAttack().ToString();
                break;
            }

            case ENSortType.enByMagAttack:
            {
                m_level.text = card.GetMagAttack().ToString();
                break;
            }

            case ENSortType.enByHp:
            {
                m_level.text = card.GetHp().ToString();
                break;
            }

            default:
                int levelMax = card.GetMaxLevel();

                if (card.Level >= levelMax)
                {
                    m_level.text = Localization.Get("MaxCardLevel");
                }
                else
                {
                    m_level.text = Localization.Get("CardLevel") + card.Level;
                }
                break;
            }
            // 文字闪现 播放一致
            m_chosen.GetComponent <TweenAlpha>().ResetToBeginning();

            // 是否在编队中
            m_chosen.SetActive(Team.Singleton.IsCardInTeam(card.Guid));

            // 是否是最爱
            m_love.gameObject.SetActive(card.Love);

            m_defaultHead.gameObject.SetActive(false);

            // 职业
            OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation);
            if (null != occupationInfo)
            {
                iconInfo = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId);

                if (null != iconInfo)
                {
                    m_occ.gameObject.SetActive(true);

                    m_occ.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName);
                }
            }


            RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(heroInfo.Rarity);
            if (null != rarityInfo)
            {
                iconInfo = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId);

                m_rarity.gameObject.SetActive(true);

                m_rarity.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName);
            }
        }
    }
Example #14
0
    // 显示更新 战斗准备
    void UpdateBattlePreparation()
    {
        for (int i = 0; i < Team.Singleton.TeamNum; ++i)
        {
            if (false == m_teamList.ContainsKey(i))
            {
                UIStageMenuTeamItem item = UIStageMenuTeamItem.Create();
                item.SetParent(m_battlePreparation.transform);
                m_teamList.Add(i, item);
            }
        }

        int curTeamIndex = Team.Singleton.m_curTeamIndex;

        foreach (KeyValuePair <int, UIStageMenuTeamItem> item in m_teamList)
        {
            if (item.Key == curTeamIndex)
            {
                item.Value.ShowWindow();
            }
            else
            {
                item.Value.HideWindow();
            }
        }

        HideAllModel();

        if (!m_teamList.ContainsKey(curTeamIndex))
        {
            Team.Singleton.m_curTeamIndex = 0;
            curTeamIndex = 0;
        }

        UIStageMenuTeamItem teamItem = m_teamList[curTeamIndex];

        teamItem.ShowWindow();

        AddModel(Team.Singleton.GetCard(curTeamIndex, Team.EDITTYPE.enMain), teamItem.m_mainModelObj);
        AddModel(Team.Singleton.GetCard(curTeamIndex, Team.EDITTYPE.enDeputy), teamItem.m_deputyModelObj);
        AddModel(Team.Singleton.GetCard(curTeamIndex, Team.EDITTYPE.enSupport), teamItem.m_supportModelObj);
        AddModel(Team.Singleton.Comrade, teamItem.m_comradeModelObj);

        UILabel mainTips    = teamItem.m_mainTips;
        UILabel deputyTips  = teamItem.m_deputyTips;
        UILabel supportTips = teamItem.m_supportTips;
        UILabel comradeTips = teamItem.m_comradeTips;

        HeroInfo info   = null;
        CSItem   csItem = null;

        csItem = Team.Singleton.Chief;
        // 主角色
        if (null != csItem)
        {
            m_battleBtn.isEnabled = true;

            info = GameTable.HeroInfoTableAsset.Lookup(csItem.IDInTable);
            if (null != info)
            {
                OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation);
                if (null != occupationInfo)
                {
                    mainTips.text  = Localization.Get("CardLevel") + csItem.Level + "\n";
                    mainTips.text += Localization.Get("Occ:") + occupationInfo.m_name + "\n";
                    mainTips.text += Localization.Get("Hp:") + csItem.GetHp() + "\n";
                    mainTips.text += Localization.Get("PhyAtk:") + csItem.GetPhyAttack() + "\n";
                    mainTips.text += Localization.Get("MagAtk:") + csItem.GetMagAttack() + "\n";
                    mainTips.text += Localization.Get("Def:") + csItem.GetPhyDefend();
                }
            }

            teamItem.m_noMainTipsLab.SetActive(false);
        }
        // 没有主角色 不可以进行战斗
        else
        {
            m_battleBtn.isEnabled = false;
            teamItem.m_noMainTipsLab.SetActive(true);
        }

        csItem = Team.Singleton.Deputy;
        // 副角色
        if (null != csItem)
        {
            info = GameTable.HeroInfoTableAsset.Lookup(csItem.IDInTable);
            if (null != info)
            {
                OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation);
                if (null != occupationInfo)
                {
                    deputyTips.text  = Localization.Get("CardLevel") + csItem.Level + "\n";
                    deputyTips.text += Localization.Get("Occ:") + occupationInfo.m_name + "\n";
                    deputyTips.text += Localization.Get("Hp:") + csItem.GetHp() + "\n";
                    deputyTips.text += Localization.Get("PhyAtk:") + csItem.GetPhyAttack() + "\n";
                    deputyTips.text += Localization.Get("MagAtk:") + csItem.GetMagAttack() + "\n";
                    deputyTips.text += Localization.Get("Def:") + csItem.GetPhyDefend();
                }
            }
        }

        csItem = Team.Singleton.Support;
        // 支援角色
        if (null != csItem)
        {
            info = GameTable.HeroInfoTableAsset.Lookup(csItem.IDInTable);
            if (null != info)
            {
                OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation);
                if (null != occupationInfo)
                {
                    supportTips.text  = Localization.Get("CardLevel") + csItem.Level + "\n";
                    supportTips.text += Localization.Get("Occ:") + occupationInfo.m_name + "\n";
                    supportTips.text += Localization.Get("Hp:") + csItem.GetHp() + "\n";
                    supportTips.text += Localization.Get("PhyAtk:") + csItem.GetPhyAttack() + "\n";
                    supportTips.text += Localization.Get("MagAtk:") + csItem.GetMagAttack() + "\n";
                    supportTips.text += Localization.Get("Def:") + csItem.GetPhyDefend();
                }
            }
        }

        csItem = Team.Singleton.Comrade;
        // 战友
        if (null != csItem)
        {
            info = GameTable.HeroInfoTableAsset.Lookup(csItem.IDInTable);
            if (null != info)
            {
                OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation);
                if (null != occupationInfo)
                {
                    comradeTips.text  = Localization.Get("CardLevel") + csItem.Level + "\n";
                    comradeTips.text += Localization.Get("Occ:") + occupationInfo.m_name + "\n";
                    comradeTips.text += Localization.Get("Hp:") + csItem.GetHp() + "\n";
                    comradeTips.text += Localization.Get("PhyAtk:") + csItem.GetPhyAttack() + "\n";
                    comradeTips.text += Localization.Get("MagAtk:") + csItem.GetMagAttack() + "\n";
                    comradeTips.text += Localization.Get("Def:") + csItem.GetPhyDefend();
                }
            }
        }


        //      TweenPosition temp = m_battlePreparation.gameObject.transform.GetComponent<TweenPosition>();
//         if (null == temp)
//         {
//             return;
//         }
//
//         Vector3 posV = m_battlePreparation.gameObject.transform.localPosition;
//         posV.x = 0;
//
//         TweenPosition.Begin(m_battlePreparation.gameObject, 0.5f, posV).method = UITweener.Method.EaseIn;



//         temp = m_battleBtn.gameObject.transform.GetComponent<TweenPosition>();
//         if (null == temp)
//         {
//             return;
//         }
//
//         posV = m_battleBtn.gameObject.transform.localPosition;
//         posV.x = 330;
//
//         TweenPosition.Begin(m_battleBtn.gameObject, 0.5f, posV).method = UITweener.Method.EaseIn;

        //m_battlePreparation.gameObject.SetActive(true);
        m_battleBtn.gameObject.SetActive(true);
        m_level.gameObject.SetActive(false);

        TweenPosition temp = m_name.gameObject.transform.GetComponent <TweenPosition>();

        if (null == temp)
        {
            return;
        }

        Vector3 posV = m_name.gameObject.transform.localPosition;

        posV.x = -700;

        TweenPosition.Begin(m_name.gameObject, 0.5f, posV).method = UITweener.Method.EaseIn;

        m_curType = (int)CurType.enBattleType;
    }
Example #15
0
    // 更新选项界面
    void UpdateOption()
    {
        m_option.gameObject.SetActive(true);

        CSItem card = CardBag.Singleton.GetCardByGuid(CardBag.Singleton.m_curOptinGuid);

        HeroInfo hero = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable);

        IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(hero.headImageId);

        RaceInfo race = GameTable.RaceInfoTableAsset.LookUp(hero.Type);

        OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(hero.Occupation);

        RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(hero.Rarity);

        IconInfomation rarityIconInfo = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId);

        //设置角色头像图片
        m_cardInfoMain.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName);

        //设置星级图标
        m_rarityTexture.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(rarityIconInfo.dirName);
        //设置种族图标
        IconInfomation raceIcon = GameTable.IconInfoTableAsset.Lookup(race.m_iconId);

        m_cardInfoRace.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(raceIcon.dirName);
        //设置职业图标
        IconInfomation occIcon = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId);

        m_cardInfoOccupation.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(occIcon.dirName);

        m_optionName.text      = hero.StrName;
        m_optionLevel.text     = Localization.Get("CardLevel") + card.Level;
        m_opInfoOp.text        = occupationInfo.m_name;
        m_optionHp.text        = "" + card.GetHp();
        m_optionMagAttack.text = "" + card.GetMagAttack();
        m_optionPhyAttack.text = "" + card.GetPhyAttack();
        m_optionRace.text      = race.m_name;

        //根据是否为最爱 决定按钮显示 图片和头像图标显示
        if (card.Love)
        {
            //button 按钮换图片
            WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enCancelLoveImageName);
            m_joinLoveSprite.spriteName = worldInfo.StringTypeValue;
            //显示最爱图标
            m_cardInfoLove.gameObject.SetActive(true);
        }
        else
        {
            //button 按钮换图片
            WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enJoinLoveImageName);
            m_joinLoveSprite.spriteName = worldInfo.StringTypeValue;
            //隐藏最爱图标
            m_cardInfoLove.gameObject.SetActive(false);
        }

        // 可强化
        if (card.IsStengthen())
        {
            m_stengThen.isEnabled = true;
        }
        else
        {
            m_stengThen.isEnabled = false;
        }

        //设置素材卡牌
        GradeUpRequireInfo gradeInfo = GameTable.gradeUpRequireAsset.Lookup(card.m_id);

        if (null == gradeInfo)
        {
            return;
        }

        // 是否达到进化所需等级
        if (card.IsEvlotion() && card.BreakCounts < gradeInfo.GradeUpTime)
        {
            m_evlotion.isEnabled = true;
        }
        else
        {
            m_evlotion.isEnabled = false;
        }


        //是否是代表卡
        m_deputyLabel.gameObject.SetActive(false);
        m_chosenLable.gameObject.SetActive(false);
        if (User.Singleton.RepresentativeCard == CardBag.Singleton.m_curOptinGuid)
        {
            m_deputyLabel.gameObject.SetActive(true);
        }
        else
        {
            if (Team.Singleton.IsCardInTeam(CardBag.Singleton.m_curOptinGuid))
            {
                m_chosenLable.gameObject.SetActive(true);
            }
        }


        //判断是否可以段位升级(待设定)
    }
Example #16
0
    public override void OnInitProps()
    {
        base.OnInitProps();
        CurrentTableInfo = GameTable.HeroInfoTableAsset.Lookup(IDInTable);
        if (CurrentTableInfo == null)
        {
            return;
        }
        if (0 == Props.GetProperty_Int32(ENProperty.vocationid))
        {
            Props.SetProperty_Int32(ENProperty.vocationid, 1);
        }
        //显示玩家名称
        AddPlayerName();

        HP              = CurrentTableInfo.FHPMax;
        MaxHP           = CurrentTableInfo.FHPMax;
        MoveSpeed       = CurrentTableInfo.MoveSpeed;
        MovebackSpeed   = CurrentTableInfo.MovebackSpeed;
        AnimationSpeed  = CurrentTableInfo.AnimationSpeed;
        AttackAnimSpeed = 1;
        Props.SetProperty_Int32(ENProperty.islive, 1);
        Props.SetProperty_Float(ENProperty.phyattack, (int)CurrentTableInfo.FPhyAttack);
        Props.SetProperty_Float(ENProperty.phydefend, (int)CurrentTableInfo.FPhyDefend);
        Props.SetProperty_Float(ENProperty.magattack, (int)CurrentTableInfo.FMagAttack);
        Props.SetProperty_Float(ENProperty.magdefend, (int)CurrentTableInfo.FMagDefend);
        Props.SetProperty_Float(ENProperty.avoid, (int)CurrentTableInfo.FAvoid);
        Props.SetProperty_Float(ENProperty.hit, (int)CurrentTableInfo.HitRate);
        Props.SetProperty_Float(ENProperty.crit, (int)CurrentTableInfo.CritRate);
        Props.SetProperty_Float(ENProperty.critParam, (int)CurrentTableInfo.CritParam);
        Props.SetProperty_Float(ENProperty.stamina, (float)CurrentTableInfo.StaminaMax);
        Props.SetProperty_Float(ENProperty.maxStamina, (float)CurrentTableInfo.StaminaMax);
        Props.SetProperty_Float(ENProperty.FResist, (float)CurrentTableInfo.FResist);
        Props.SetProperty_Float(ENProperty.AnitInterfere, (float)CurrentTableInfo.AnitInterfereRate);
        Props.SetProperty_Float(ENProperty.AnitInterrupt, (float)CurrentTableInfo.AnitInterruptRate);
        Props.SetProperty_Float(ENProperty.AnitRepel, (float)CurrentTableInfo.AnitRepelRate);
        Props.SetProperty_Float(ENProperty.AnitLauncher, (float)CurrentTableInfo.AnitLauncherRate);
        Props.SetProperty_Float(ENProperty.WoundParam, CurrentTableInfo.WoundParam);
        Props.SetProperty_Int32(ENProperty.WeaponID, CurrentTableInfo.WeaponId);
        Props.SetProperty_Float(ENProperty.ModelScale, CurrentTableInfo.ModelScale);

        CSItem card = CardBag.Singleton.GetCardByGuid(GUID);

        if (card == null)
        {
            if (Type == ActorType.enFollow)
            {
                card = Team.Singleton.Comrade;
            }
        }
        if (card != null)
        {
            MaxHP = card.GetHp();
            HP    = MaxHP;
            Level = card.Level;
            Props.SetProperty_Float(ENProperty.phyattack, card.GetPhyAttack());
            Props.SetProperty_Float(ENProperty.magattack, card.GetMagAttack());
            Props.SetProperty_Float(ENProperty.phydefend, card.GetPhyDefend());
            Props.SetProperty_Float(ENProperty.magdefend, card.GetMagDefend());

            PropertyCustomValue value = Props.GetProperty_Custom(ENProperty.SkillIDList);
            if (value == null)
            {
                Debug.LogWarning("ENProperty.SkillIDList is null");
                return;
            }
            PropertyValueIntListView skillIDList = value as PropertyValueIntListView;
            if (skillIDList == null)
            {
                Debug.LogWarning("ENProperty.SkillIDList cast fail");
                return;
            }
            for (int i = 0; i < card.SkillItemInfoList.Length; ++i)
            {
                skillIDList.m_list[i] = card.SkillItemInfoList[i].m_skillID;
            }
            Props.SetProperty_Custom(ENProperty.SkillIDList, skillIDList);
        }
    }