Exemple #1
0
            public void Validate(HeroKDA kdaData)
            {
                this.kdaData = kdaData;
                this.icon.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)kdaData.HeroId, 0)), Singleton <CBattleSystem> .instance.m_FormScript, true, false, false);
                Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref kdaData.actorHero);

                this.playerName.text = ownerPlayer.Name;
                this.heroName.text   = kdaData.actorHero.handle.TheStaticData.TheResInfo.Name;
                this.level.text      = kdaData.actorHero.handle.ValueComponent.actorSoulLevel.ToString();
                this.killNum.text    = kdaData.numKill.ToString();
                this.deadNum.text    = kdaData.numDead.ToString();
                this.killMon.text    = (kdaData.numKillMonster + kdaData.numKillSoldier).ToString();
                this.killMon.text    = kdaData.TotalCoin.ToString();
                this.assistNum.text  = kdaData.numAssist.ToString();
                int num = 1;

                for (int i = 0; i < 6; i++)
                {
                    ushort equipID = kdaData.Equips[i].m_equipID;
                    if (equipID != 0)
                    {
                        num++;
                        CUICommonSystem.SetEquipIcon(equipID, this.equipList[i].gameObject, Singleton <CBattleSystem> .instance.m_FormScript);
                    }
                }
                for (int j = num; j <= 6; j++)
                {
                    this.equipList[j - 1].gameObject.GetComponent <Image>().SetSprite(string.Format("{0}EquipmentSpace", CUIUtility.s_Sprite_Dynamic_Talent_Dir), Singleton <CBattleSystem> .instance.m_FormScript, true, false, false);
                }
                if (ownerPlayer == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer())
                {
                    this.playerName.color = CUIUtility.s_Text_Color_Self;
                    this.mineBg.CustomSetActive(true);
                }
                else
                {
                    this.mineBg.CustomSetActive(false);
                }
            }
Exemple #2
0
 private void InitCampInfoUIList(COM_PLAYERCAMP listCamp, List <HeroKDA> heroList, CUIListScript baseInfoUIList, CUIListScript equipInfoUIList)
 {
     if (((null != baseInfoUIList) && (heroList != null)) && (heroList.Count != 0))
     {
         baseInfoUIList.SetElementAmount(5);
         equipInfoUIList.SetElementAmount(5);
         for (int i = 0; i < 5; i++)
         {
             GameObject gameObject    = baseInfoUIList.GetElemenet(i).gameObject;
             GameObject equipInfoItem = equipInfoUIList.GetElemenet(i).gameObject;
             if (i < heroList.Count)
             {
                 HeroKDA      okda = heroList[i];
                 HeroInfoItem item = new HeroInfoItem(listCamp, i, okda, gameObject, equipInfoItem);
                 this._heroWrapDict.Add(okda.actorHero.handle.ObjID, item);
             }
             else
             {
                 HeroInfoItem.MakeEmpty(gameObject, equipInfoItem);
             }
         }
     }
 }
Exemple #3
0
            public HeroItem(GameObject node)
            {
                this.root       = node;
                this.icon       = Utility.GetComponetInChild <Image>(node, "HeadIcon");
                this.mineBg     = Utility.FindChild(node, "MineBg");
                this.level      = Utility.GetComponetInChild <Text>(node, "Level");
                this.playerName = Utility.GetComponetInChild <Text>(node, "PlayerName");
                this.heroName   = Utility.GetComponetInChild <Text>(node, "HeroName");
                this.killNum    = Utility.GetComponetInChild <Text>(node, "KillNum");
                this.deadNum    = Utility.GetComponetInChild <Text>(node, "DeadNum");
                this.killMon    = Utility.GetComponetInChild <Text>(node, "KillMon");
                this.assistNum  = Utility.GetComponetInChild <Text>(node, "AssistNum");
                this.reviveTime = Utility.GetComponetInChild <Text>(node, "ReviveTime");
                GameObject p = Utility.FindChild(node, "TalentIcon");

                this.equipList[0] = Utility.GetComponetInChild <Image>(p, "img1");
                this.equipList[1] = Utility.GetComponetInChild <Image>(p, "img2");
                this.equipList[2] = Utility.GetComponetInChild <Image>(p, "img3");
                this.equipList[3] = Utility.GetComponetInChild <Image>(p, "img4");
                this.equipList[4] = Utility.GetComponetInChild <Image>(p, "img5");
                this.equipList[5] = Utility.GetComponetInChild <Image>(p, "img6");
                node.transform.FindChild("ReviveTime").gameObject.SetActive(true);
                this.kdaData = null;
            }
Exemple #4
0
 private void InitCampInfoUIList(COM_PLAYERCAMP listCamp, List <HeroKDA> heroList, CUIListScript baseInfoUIList, CUIListScript equipInfoUIList)
 {
     if (null == baseInfoUIList || heroList == null || heroList.get_Count() == 0)
     {
         return;
     }
     baseInfoUIList.SetElementAmount(5);
     equipInfoUIList.SetElementAmount(5);
     for (int i = 0; i < 5; i++)
     {
         GameObject gameObject  = baseInfoUIList.GetElemenet(i).gameObject;
         GameObject gameObject2 = equipInfoUIList.GetElemenet(i).gameObject;
         if (i < heroList.get_Count())
         {
             HeroKDA      heroKDA      = heroList.get_Item(i);
             HeroInfoItem heroInfoItem = new HeroInfoItem(listCamp, i, heroKDA, gameObject, gameObject2);
             this._heroWrapDict.Add(heroKDA.actorHero.get_handle().ObjID, heroInfoItem);
         }
         else
         {
             HeroInfoItem.MakeEmpty(gameObject, gameObject2);
         }
     }
 }
Exemple #5
0
            public HeroItem(GameObject heroNode, GameObject matchNode, GameObject valueNode)
            {
                this.rootHeroView   = heroNode;
                this.rootMatchInfo  = matchNode;
                this.rootValueInfo  = valueNode;
                this.icon           = Utility.GetComponetInChild <Image>(heroNode, "HeadIcon");
                this.mineBg         = Utility.FindChild(heroNode, "MineBg");
                this.level          = Utility.GetComponetInChild <Text>(heroNode, "Level");
                this.playerName     = Utility.GetComponetInChild <Text>(heroNode, "PlayerName");
                this.heroName       = Utility.GetComponetInChild <Text>(heroNode, "HeroName");
                this.reviveTime     = Utility.GetComponetInChild <Text>(heroNode, "ReviveTime");
                this.voiceIconsNode = Utility.FindChild(heroNode, "Voice");
                this.killNum        = Utility.GetComponetInChild <Text>(matchNode, "KillNum");
                this.deadNum        = Utility.GetComponetInChild <Text>(matchNode, "DeadNum");
                this.killMon        = Utility.GetComponetInChild <Text>(matchNode, "KillMon");
                this.assistNum      = Utility.GetComponetInChild <Text>(matchNode, "AssistNum");
                GameObject p = Utility.FindChild(matchNode, "TalentIcon");

                this.equipList[0]     = Utility.GetComponetInChild <Image>(p, "img1");
                this.equipList[1]     = Utility.GetComponetInChild <Image>(p, "img2");
                this.equipList[2]     = Utility.GetComponetInChild <Image>(p, "img3");
                this.equipList[3]     = Utility.GetComponetInChild <Image>(p, "img4");
                this.equipList[4]     = Utility.GetComponetInChild <Image>(p, "img5");
                this.equipList[5]     = Utility.GetComponetInChild <Image>(p, "img6");
                this.talentSkill      = Utility.FindChild(matchNode, "TalentSkill");
                this.talentSkillImage = Utility.GetComponetInChild <Image>(this.talentSkill, "Image");
                this.talentSkillCD    = Utility.GetComponetInChild <Text>(this.talentSkill, "TimeCD");
                this.heroHP           = Utility.GetComponetInChild <Text>(valueNode, "ValueInfo/HP");
                this.heroAD           = Utility.GetComponetInChild <Text>(valueNode, "ValueInfo/AD");
                this.heroAP           = Utility.GetComponetInChild <Text>(valueNode, "ValueInfo/AP");
                this.heroADDef        = Utility.GetComponetInChild <Text>(valueNode, "ValueInfo/ADDef");
                this.heroAPDef        = Utility.GetComponetInChild <Text>(valueNode, "ValueInfo/APDef");
                heroNode.transform.FindChild("ReviveTime").gameObject.SetActive(true);
                matchNode.transform.FindChild("TalentSkill/TimeCD").gameObject.SetActive(true);
                this.kdaData = null;
            }
        private void SetName(CUIListElementScript elemt, HeroKDA p)
        {
            Text component = elemt.transform.FindChild("Name").GetComponent <Text>();

            component.set_text(CHeroInfo.GetHeroName((uint)p.HeroId));
        }
        private void SetHead(CUIListElementScript elemt, HeroKDA p)
        {
            Image component = elemt.transform.FindChild("Head/Head").GetComponent <Image>();

            component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)p.HeroId, 0u)), Singleton <CBattleSystem> .instance.FormScript, true, false, false, false);
        }
 private void SetIRHeroInfo(CUIListElementScript elemt, HeroKDA hero)
 {
     this.SetHead(elemt, hero);
     this.SetName(elemt, hero);
 }
        private static void SetHeroStat_Share(CUIFormScript formScript, GameObject item, HeroKDA kda, bool bSelf, bool bMvp, bool bWin)
        {
            Text componetInChild = Utility.GetComponetInChild <Text>(item, "Txt_PlayerLevel");

            componetInChild.set_text(string.Format("Lv.{0}", kda.SoulLevel.ToString()));
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)kda.HeroId);

            DebugHelper.Assert(dataByKey != null);
            item.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>().set_text(StringHelper.UTF8BytesToString(ref dataByKey.szName));
            string text  = (kda.numKill < 10) ? string.Format(" {0} ", kda.numKill.ToString()) : kda.numKill.ToString();
            string text2 = (kda.numDead < 10) ? string.Format(" {0} ", kda.numDead.ToString()) : kda.numDead.ToString();
            string text3 = (kda.numAssist < 10) ? string.Format(" {0}", kda.numAssist.ToString()) : kda.numAssist.ToString();

            item.transform.Find("Txt_KDA").gameObject.GetComponent <Text>().set_text(string.Format("{0} / {1} / {2}", text, text2, text3));
            Image component = item.transform.Find("KillerImg").gameObject.GetComponent <Image>();

            component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)kda.HeroId, 0u)), formScript, true, false, false, false);
            GameObject gameObject = item.transform.Find("Mvp").gameObject;

            gameObject.CustomSetActive(bMvp);
            if (bMvp)
            {
                Image component2 = gameObject.GetComponent <Image>();
                if (bWin)
                {
                    component2.SetSprite(CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Dir + "Img_Icon_Red_Mvp", formScript, true, false, false, false);
                    component2.gameObject.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
                }
                else
                {
                    component2.SetSprite(CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Dir + "Img_Icon_Blue_Mvp", formScript, true, false, false, false);
                    component2.gameObject.transform.localScale = new Vector3(0.6f, 0.6f, 1f);
                }
            }
            for (int i = 0; i < 5; i++)
            {
                uint  dwTalentID = kda.TalentArr[i].dwTalentID;
                Image component3 = item.transform.FindChild(string.Format("TianFu/TianFuIcon{0}", (i + 1).ToString())).GetComponent <Image>();
                if (dwTalentID == 0u)
                {
                    component3.gameObject.CustomSetActive(false);
                }
                else
                {
                    component3.gameObject.CustomSetActive(true);
                    ResTalentLib dataByKey2 = GameDataMgr.talentLib.GetDataByKey(dwTalentID);
                    component3.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + dataByKey2.dwIcon, formScript, true, false, false, false);
                }
            }
            int num = 1;

            for (int j = 1; j < 13; j++)
            {
                switch (j)
                {
                case 1:
                    if (kda.LegendaryNum > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.Legendary, num);
                        num++;
                    }
                    break;

                case 2:
                    if (kda.PentaKillNum > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.PentaKill, num);
                        num++;
                    }
                    break;

                case 3:
                    if (kda.QuataryKillNum > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.QuataryKill, num);
                        num++;
                    }
                    break;

                case 4:
                    if (kda.TripleKillNum > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.TripleKill, num);
                        num++;
                    }
                    break;

                case 5:
                    if (kda.DoubleKillNum > 0)
                    {
                    }
                    break;

                case 6:
                    if (kda.bKillMost)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.KillMost, num);
                        num++;
                    }
                    break;

                case 7:
                    if (kda.bHurtMost && kda.hurtToEnemy > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.HurtMost, num);
                        num++;
                    }
                    break;

                case 8:
                    if (kda.bHurtTakenMost && kda.hurtTakenByEnemy > 0)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.HurtTakenMost, num);
                        num++;
                    }
                    break;

                case 9:
                    if (kda.bAsssistMost)
                    {
                        CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.AsssistMost, num);
                        num++;
                    }
                    break;
                }
            }
            for (int k = num; k <= 6; k++)
            {
                CSettlementView.SetAchievementIcon(formScript, item, PvpAchievement.NULL, k);
            }
        }
            public void Validate(HeroKDA kdaData)
            {
                if (kdaData != null)
                {
                    this.kdaData = kdaData;
                }
                if (this.kdaData == null)
                {
                    return;
                }
                this.icon.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)this.kdaData.HeroId, 0u)), Singleton <CBattleSystem> .get_instance().FormScript, true, false, false, false);
                Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref this.kdaData.actorHero);

                this.playerName.text = ownerPlayer.Name;
                this.heroName.text   = this.kdaData.actorHero.get_handle().TheStaticData.TheResInfo.Name;
                this.level.text      = this.kdaData.actorHero.get_handle().ValueComponent.actorSoulLevel.ToString();
                this.killNum.text    = this.kdaData.numKill.ToString();
                this.deadNum.text    = this.kdaData.numDead.ToString();
                this.killMon.text    = (this.kdaData.numKillMonster + this.kdaData.numKillSoldier).ToString();
                this.killMon.text    = this.kdaData.TotalCoin.ToString();
                this.assistNum.text  = this.kdaData.numAssist.ToString();
                int num = 0;

                for (int i = 0; i < 6; i++)
                {
                    ushort equipID = this.kdaData.Equips[i].m_equipID;
                    if (equipID != 0)
                    {
                        CUICommonSystem.SetEquipIcon(equipID, this.equipList[num++].gameObject, Singleton <CBattleSystem> .get_instance().FormScript);
                    }
                }
                for (int j = num; j < 6; j++)
                {
                    this.equipList[j].gameObject.GetComponent <Image>().SetSprite(string.Format("{0}BattleSettle_EquipmentSpaceNew", CUIUtility.s_Sprite_Dynamic_Talent_Dir), Singleton <CBattleSystem> .get_instance().FormScript, true, false, false, false);
                }
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if (curLvelContext != null && curLvelContext.m_bEnableOrnamentSlot && curLvelContext.m_bEnableShopHorizonTab)
                {
                    ushort horizonEquipId = this.kdaData.actorHero.get_handle().EquipComponent.m_horizonEquipId;
                    if (horizonEquipId == 0)
                    {
                        this.horizonEquipImg.SetSprite(string.Format("{0}BattleSettle_EquipmentSpaceNew", CUIUtility.s_Sprite_Dynamic_Talent_Dir), Singleton <CBattleSystem> .get_instance().FormScript, true, false, false, false);
                    }
                    else
                    {
                        CUICommonSystem.SetEquipIcon(horizonEquipId, this.horizonEquipImg.gameObject, Singleton <CBattleSystem> .get_instance().FormScript);
                    }
                }
                if (ownerPlayer == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer())
                {
                    this.playerName.color = CUIUtility.s_Text_Color_Self;
                    this.mineBg.CustomSetActive(true);
                }
                else
                {
                    if (ownerPlayer.PlayerCamp == 1)
                    {
                        this.playerName.color = CUIUtility.s_Text_Color_Camp_1;
                    }
                    else
                    {
                        this.playerName.color = CUIUtility.s_Text_Color_Camp_2;
                    }
                    this.mineBg.CustomSetActive(false);
                }
            }
 private int SortByPos(HeroKDA left, HeroKDA right)
 {
     return(left.CampPos - right.CampPos);
 }
 private int SortByCoinAndPos(HeroKDA left, HeroKDA right)
 {
     return((right.TotalCoin - left.TotalCoin) * 10 + (left.CampPos - right.CampPos));
 }
Exemple #13
0
        private static void SetHeroStat_Share(CUIFormScript formScript, GameObject item, HeroKDA kda, bool bSelf, bool bMvp, bool bWin)
        {
            Utility.GetComponetInChild <Text>(item, "Txt_PlayerLevel").text = string.Format("Lv.{0}", kda.SoulLevel.ToString());
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)kda.HeroId);

            DebugHelper.Assert(dataByKey != null);
            item.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>().text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
            string str  = (kda.numKill >= 10) ? kda.numKill.ToString() : string.Format(" {0} ", kda.numKill.ToString());
            string str2 = (kda.numDead >= 10) ? kda.numDead.ToString() : string.Format(" {0} ", kda.numDead.ToString());
            string str3 = (kda.numAssist >= 10) ? kda.numAssist.ToString() : string.Format(" {0}", kda.numAssist.ToString());

            item.transform.Find("Txt_KDA").gameObject.GetComponent <Text>().text = string.Format("{0} / {1} / {2}", str, str2, str3);
            item.transform.Find("KillerImg").gameObject.GetComponent <Image>().SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)kda.HeroId, 0)), formScript, true, false, false);
            GameObject gameObject = item.transform.Find("Mvp").gameObject;

            gameObject.CustomSetActive(bMvp);
            if (bMvp)
            {
                Image component = gameObject.GetComponent <Image>();
                if (bWin)
                {
                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Dir + "Img_Icon_Red_Mvp", formScript, true, false, false);
                    component.gameObject.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
                }
                else
                {
                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Pvp_Settle_Dir + "Img_Icon_Blue_Mvp", formScript, true, false, false);
                    component.gameObject.transform.localScale = new Vector3(0.6f, 0.6f, 1f);
                }
            }
            for (int i = 0; i < 5; i++)
            {
                uint  dwTalentID = kda.TalentArr[i].dwTalentID;
                int   num12      = i + 1;
                Image image      = item.transform.FindChild(string.Format("TianFu/TianFuIcon{0}", num12.ToString())).GetComponent <Image>();
                if (dwTalentID == 0)
                {
                    image.gameObject.CustomSetActive(false);
                }
                else
                {
                    image.gameObject.CustomSetActive(true);
                    ResTalentLib lib = GameDataMgr.talentLib.GetDataByKey(dwTalentID);
                    image.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + lib.dwIcon, formScript, true, false, false);
                }
            }
            int count = 1;

            for (int j = 1; j < 13; j++)
            {
                switch (((PvpAchievement)j))
                {
                case PvpAchievement.Legendary:
                    if (kda.LegendaryNum > 0)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.Legendary, count);
                        count++;
                    }
                    break;

                case PvpAchievement.PentaKill:
                    if (kda.PentaKillNum > 0)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.PentaKill, count);
                        count++;
                    }
                    break;

                case PvpAchievement.QuataryKill:
                    if (kda.QuataryKillNum > 0)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.QuataryKill, count);
                        count++;
                    }
                    break;

                case PvpAchievement.TripleKill:
                    if (kda.TripleKillNum > 0)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.TripleKill, count);
                        count++;
                    }
                    break;

                case PvpAchievement.DoubleKill:
                    if (kda.DoubleKillNum <= 0)
                    {
                    }
                    break;

                case PvpAchievement.KillMost:
                    if (kda.bKillMost)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.KillMost, count);
                        count++;
                    }
                    break;

                case PvpAchievement.HurtMost:
                    if (kda.bHurtMost && (kda.hurtToEnemy > 0))
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.HurtMost, count);
                        count++;
                    }
                    break;

                case PvpAchievement.HurtTakenMost:
                    if (kda.bHurtTakenMost && (kda.hurtTakenByEnemy > 0))
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.HurtTakenMost, count);
                        count++;
                    }
                    break;

                case PvpAchievement.AsssistMost:
                    if (kda.bAsssistMost)
                    {
                        SetAchievementIcon(formScript, item, PvpAchievement.AsssistMost, count);
                        count++;
                    }
                    break;
                }
            }
            for (int k = count; k <= 6; k++)
            {
                SetAchievementIcon(formScript, item, PvpAchievement.NULL, k);
            }
        }
Exemple #14
0
        private static void SetPlayerStat(CUIFormScript formScript, GameObject item, PlayerKDA playerKDA, HeroKDA kda)
        {
            Text componetInChild = Utility.GetComponetInChild <Text>(item, "Txt_PlayerName");

            componetInChild.text  = playerKDA.PlayerName;
            componetInChild.color = (playerKDA.PlayerCamp != COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? new Color(0.545f, 0f, 0f, 1f) : new Color(0.031f, 0.961f, 0f, 1f);
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)kda.HeroId);

            DebugHelper.Assert(dataByKey != null);
            item.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>().text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
            string str  = (kda.numKill >= 10) ? kda.numKill.ToString() : string.Format(" {0} ", kda.numKill.ToString());
            string str2 = (kda.numDead >= 10) ? kda.numDead.ToString() : string.Format(" {0} ", kda.numDead.ToString());

            item.transform.Find("Txt_KDA").gameObject.GetComponent <Text>().text       = string.Format("{0} / {1}", str, str2);
            item.transform.Find("Txt_Hurt").gameObject.GetComponent <Text>().text      = kda.hurtToEnemy.ToString();
            item.transform.Find("Txt_HurtTaken").gameObject.GetComponent <Text>().text = kda.hurtTakenByEnemy.ToString();
            item.transform.Find("Txt_Heal").gameObject.GetComponent <Text>().text      = kda.hurtToHero.ToString();
            item.transform.Find("KillerImg").gameObject.GetComponent <Image>().SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)kda.HeroId, 0)), formScript, true, false, false);
            item.CustomSetActive(true);
        }
Exemple #15
0
        public void Init(bool bWin)
        {
            this.m_allAchievements = new bool[8];
            this.m_curAchievemnt   = RES_SHOW_ACHIEVEMENT_TYPE.RES_SHOW_ACHIEVEMENT_COUNT;
            if (Singleton <BattleLogic> .GetInstance().battleStat == null || Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat == null)
            {
                return;
            }
            PlayerKDA hostKDA = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat.GetHostKDA();

            if (hostKDA == null)
            {
                return;
            }
            uint mvpPlayer = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, bWin);

            if (mvpPlayer != 0u && mvpPlayer == hostKDA.PlayerId)
            {
                this.m_allAchievements[7] = true;
            }
            COMDT_ACNT_INFO acntInfo = Singleton <BattleStatistic> .GetInstance().acntInfo;

            if (acntInfo != null)
            {
                if (acntInfo.dwCurWeekContinousWinNum == 15u)
                {
                    this.m_allAchievements[0] = true;
                }
                else if (acntInfo.dwCurWeekContinousWinNum == 10u)
                {
                    this.m_allAchievements[2] = true;
                }
                else if (acntInfo.dwCurWeekContinousWinNum == 5u)
                {
                    this.m_allAchievements[4] = true;
                }
            }
            ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator();
            while (enumerator.MoveNext())
            {
                HeroKDA current = enumerator.Current;
                if (current != null)
                {
                    if (current.LegendaryNum > 0)
                    {
                        this.m_allAchievements[5] = true;
                    }
                    if (current.PentaKillNum > 0)
                    {
                        this.m_allAchievements[1] = true;
                    }
                    if (current.QuataryKillNum > 0)
                    {
                        this.m_allAchievements[3] = true;
                    }
                    if (current.TripleKillNum > 0)
                    {
                        this.m_allAchievements[6] = true;
                    }
                }
            }
        }