Example #1
0
        public void OnFill(Hashtable hash, string timeStr = null)
        {
            if (hash == null || hash.Count == 0)
            {
                EmptyObj.CustomSetActive(true);
                PlayerInfoObj.CustomSetActive(false);
                InfoLabel.text = EB.Localizer.GetString("ID_PASS_INFO_NOBODY_IN_RANK");
                TimeLabel.text = string.Format("{0}{1}", timeStr, EB.Localizer.GetString("ID_NATION_BATTLE_BUFF_FULL_CALL"));
            }
            else
            {
                if (hash.Values != null)
                {
                    foreach (Hashtable Temp in hash.Values)
                    {
                        EmptyObj.CustomSetActive(false);
                        PlayerInfoObj.CustomSetActive(true);
                        string Tid = EB.Dot.String("userTeam.normal.userInfo.leaderId", Temp, null);
                        Tid = (Tid == null) ? "10011" : Tid;
                        int    skin        = EB.Dot.Integer("userTeam.normal.userInfo.skin", Temp, 0);
                        string characterid = Hotfix_LT.Data.CharacterTemplateManager.Instance.TemplateidToCharacterid(Tid);
                        var    charTpl     = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(characterid, skin);

                        PlayerIcon.spriteName = charTpl.icon;
                        string frameStr = EB.Dot.String("userTeam.normal.userInfo.headFrame", Temp, null);
                        PlayerFrame.spriteName = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetHeadFrame(frameStr).iconId;
                        PlayerLevel.text       = EB.Dot.String("userTeam.normal.userInfo.level", Temp, null);

                        InfoLabel.text = EB.Dot.String("userTeam.normal.userInfo.name", Temp, null);
                        TimeLabel.text = timeStr;

                        var teamInfo = LTFormationDataManager.Instance.GetOtherPalyerPartnerDataList("normal", Temp);
                        for (int i = 0; i < 6; ++i)
                        {
                            if (teamInfo.Count > i)//有数据
                            {
                                if (ItemList.Count > i)
                                {
                                    ItemList[i].Fill(teamInfo[i]);
                                }
                                else
                                {
                                    FormationPartnerItem item = UIControllerHotfix.InstantiateEx <FormationPartnerItem>(ItemPrefab, ItemGrid.transform);
                                    item.Fill(teamInfo[i]);
                                    ItemList.Add(item);
                                }
                            }
                            else//无数据
                            {
                                if (ItemList.Count > i)
                                {
                                    ItemList[i].Fill(null);
                                }
                            }
                        }
                        ItemGrid.repositionNow = true;
                    }
                }
            }
        }
Example #2
0
        public override void Awake()
        {
            base.Awake();
            EmptyObj = mDMono.transform.Find("Empty").gameObject;

            PlayerInfoObj = mDMono.transform.Find("PlayerInfo").gameObject;
            PlayerIcon    = PlayerInfoObj.transform.Find("Icon").GetComponent <UISprite>();
            PlayerFrame   = PlayerIcon.transform.Find("Frame").GetComponent <UISprite>();
            PlayerLevel   = PlayerInfoObj.transform.Find("LevelBG/Level").GetComponent <UILabel>();
            ItemGrid      = PlayerInfoObj.transform.Find("UIGrid").GetComponent <UIGrid>();
            ItemPrefab    = ItemGrid.transform.Find("Item").GetMonoILRComponent <FormationPartnerItem>();

            InfoLabel = mDMono.transform.Find("InfoLabel").GetComponent <UILabel>();
            TimeLabel = mDMono.transform.Find("TimeLabel").GetComponent <UILabel>();

            ItemList = new List <FormationPartnerItem>();
        }