Example #1
0
        private static void SetTeamHeroList(GameObject list, COMDT_BATTLELIST_LIST battleList, uint battleListID, out int teamPower)
        {
            CUIListScript component = list.GetComponent <CUIListScript>();

            teamPower = 0;
            component.SetElementAmount(0);
            if (battleList == null || battleList.dwListNum == 0u)
            {
                return;
            }
            int num = 0;

            while ((long)num < (long)((ulong)battleList.dwListNum))
            {
                if (battleList.astBattleList[num].dwBattleListID == battleListID)
                {
                    if (battleList.astBattleList[num].stBattleList.wHeroCnt == 0)
                    {
                        return;
                    }
                    component.SetElementAmount((int)battleList.astBattleList[num].stBattleList.wHeroCnt);
                    int num2 = 0;
                    for (int i = 0; i < (int)battleList.astBattleList[num].stBattleList.wHeroCnt; i++)
                    {
                        CUIListElementScript elemenet   = component.GetElemenet(i);
                        GameObject           gameObject = elemenet.gameObject.transform.Find("heroItemCell").gameObject;
                        if (battleList.astBattleList[num].stBattleList.BattleHeroList[i] > 0u)
                        {
                            IHeroData heroData = CHeroDataFactory.CreateHeroData(battleList.astBattleList[num].stBattleList.BattleHeroList[i]);
                            teamPower += heroData.combatEft;
                            CUICommonSystem.SetHeroItemData(elemenet.m_belongedFormScript, gameObject, heroData, enHeroHeadType.enIcon, false, true);
                            elemenet.gameObject.CustomSetActive(true);
                            gameObject.gameObject.CustomSetActive(true);
                            num2++;
                        }
                        else
                        {
                            elemenet.gameObject.CustomSetActive(false);
                            gameObject.gameObject.CustomSetActive(false);
                        }
                    }
                    break;
                }
                else
                {
                    num++;
                }
            }
        }
Example #2
0
        private static void SetTeamHeroList(GameObject list, COMDT_BATTLELIST_LIST battleList, uint battleListID, out int teamPower)
        {
            CUIListScript        component = list.GetComponent <CUIListScript>();
            CUIListElementScript elemenet  = null;

            teamPower = 0;
            component.SetElementAmount(0);
            if ((battleList != null) && (battleList.dwListNum != 0))
            {
                for (int i = 0; i < battleList.dwListNum; i++)
                {
                    if (battleList.astBattleList[i].dwBattleListID == battleListID)
                    {
                        if (battleList.astBattleList[i].stBattleList.wHeroCnt == 0)
                        {
                            return;
                        }
                        component.SetElementAmount(battleList.astBattleList[i].stBattleList.wHeroCnt);
                        int num2 = 0;
                        for (int j = 0; j < battleList.astBattleList[i].stBattleList.wHeroCnt; j++)
                        {
                            elemenet = component.GetElemenet(j);
                            GameObject gameObject = elemenet.gameObject.transform.Find("heroItemCell").gameObject;
                            if (battleList.astBattleList[i].stBattleList.BattleHeroList[j] > 0)
                            {
                                IHeroData data = CHeroDataFactory.CreateHeroData(battleList.astBattleList[i].stBattleList.BattleHeroList[j]);
                                teamPower += data.combatEft;
                                CUICommonSystem.SetHeroItemData(elemenet.m_belongedFormScript, gameObject, data, enHeroHeadType.enIcon, false, enHeroInfoShowType.enPVE);
                                elemenet.gameObject.CustomSetActive(true);
                                gameObject.gameObject.CustomSetActive(true);
                                num2++;
                            }
                            else
                            {
                                elemenet.gameObject.CustomSetActive(false);
                                gameObject.gameObject.CustomSetActive(false);
                            }
                        }
                        break;
                    }
                }
            }
        }