Beispiel #1
0
 public void Setup(TowerResuponse.TowerRankParam rankData)
 {
     if (rankData == null)
     {
         return;
     }
     this.SetText(this.m_UserName, rankData.name);
     this.SetText(this.m_UserLv, rankData.lv);
     this.SetText(this.m_Rank, rankData.rank);
     this.SetText(this.m_Score, rankData.score);
 }
Beispiel #2
0
 public void SetRankData(TowerRankItem rankItem, TowerResuponse.TowerRankParam[] rankData)
 {
     if (rankData == null || rankData.Length < 1)
     {
         GameUtility.SetGameObjectActive((Component)rankItem, false);
     }
     else
     {
         TowerResuponse.TowerRankParam rankData1 = rankData[0];
         if (!Object.op_Inequality((Object)rankItem, (Object)null))
         {
             return;
         }
         DataSource.Bind <UnitData>(((Component)rankItem).get_gameObject(), rankData1.unit);
         rankItem.Setup(rankData1);
         GameParameter.UpdateAll(((Component)rankItem).get_gameObject());
     }
 }
Beispiel #3
0
        private void SetUp()
        {
            string str = string.Empty;

            if (this.Type == AwardItem.PlayerType.Player)
            {
                PlayerData dataOfClass = DataSource.FindDataOfClass <PlayerData>(((Component)this).get_gameObject(), (PlayerData)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.SelectedAward;
                }
            }
            else if (this.Type == AwardItem.PlayerType.Friend)
            {
                FriendData dataOfClass = DataSource.FindDataOfClass <FriendData>(((Component)this).get_gameObject(), (FriendData)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.SelectAward;
                }
            }
            else if (this.Type == AwardItem.PlayerType.ArenaPlayer)
            {
                ArenaPlayer dataOfClass = DataSource.FindDataOfClass <ArenaPlayer>(((Component)this).get_gameObject(), (ArenaPlayer)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.SelectAward;
                }
            }
            else if (this.Type == AwardItem.PlayerType.MultiPlayer)
            {
                JSON_MyPhotonPlayerParam dataOfClass = DataSource.FindDataOfClass <JSON_MyPhotonPlayerParam>(((Component)this).get_gameObject(), (JSON_MyPhotonPlayerParam)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.award;
                }
            }
            else if (this.Type == AwardItem.PlayerType.ChatPlayer)
            {
                ChatPlayerData dataOfClass = DataSource.FindDataOfClass <ChatPlayerData>(((Component)this).get_gameObject(), (ChatPlayerData)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.award;
                }
            }
            else if (this.Type == AwardItem.PlayerType.TowerPlayer)
            {
                TowerResuponse.TowerRankParam dataOfClass = DataSource.FindDataOfClass <TowerResuponse.TowerRankParam>(((Component)this).get_gameObject(), (TowerResuponse.TowerRankParam)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.selected_award;
                }
            }
            this.mSelectedAward = str;
            if (!string.IsNullOrEmpty(this.mSelectedAward))
            {
                AwardParam awardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAwardParam(this.mSelectedAward);

                if (awardParam != null)
                {
                    this.mAwardParam = awardParam;
                }
            }
            else
            {
                this.mAwardParam = (AwardParam)null;
            }
            this.IsDone = true;
        }
Beispiel #4
0
        private void UpdateValue(ListItemEvents obj, int num, TowerResuponse.TowerRankParam param, bool isSpeed)
        {
            if (Object.op_Equality((Object)this.mSheet, (Object)null))
            {
                return;
            }
            GameManager    instance       = MonoSingleton <GameManager> .Instance;
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
            TowerParam     tower          = instance.FindTower(towerResuponse.TowerID);

            DataSource.Bind <TowerResuponse.TowerRankParam>(((Component)obj).get_gameObject(), param);
            Transform child1 = ((Component)obj).get_transform().FindChild("body");

            if (!Object.op_Inequality((Object)child1, (Object)null))
            {
                return;
            }
            Transform child2 = ((Component)child1).get_transform().FindChild("ranking");

            if (Object.op_Inequality((Object)child2, (Object)null))
            {
                Image component = (Image)((Component)child2).GetComponent <Image>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    if (num < this.SHOW_VIP_RANK)
                    {
                        component.set_sprite(this.mSheet.GetSprite(num.ToString()));
                    }
                    else
                    {
                        component.set_sprite(this.mSheet.GetSprite("normal"));
                    }
                }
            }
            Transform child3 = ((Component)child1).get_transform().FindChild("rank");

            if (Object.op_Inequality((Object)child3, (Object)null))
            {
                Text component = (Text)((Component)child3).GetComponent <Text>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    if (num < this.SHOW_VIP_RANK)
                    {
                        component.set_text(string.Empty);
                    }
                    else
                    {
                        component.set_text((num + 1).ToString() + LocalizedText.Get("sys.TOWER_RANK_LABEL"));
                    }
                }
            }
            Transform child4 = ((Component)child1).get_transform().FindChild("Text_player");

            if (Object.op_Inequality((Object)child4, (Object)null))
            {
                Text component = (Text)((Component)child4).GetComponent <Text>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.set_text(param.name);
                }
            }
            Transform child5 = ((Component)child1).get_transform().FindChild("player_level");

            if (Object.op_Inequality((Object)child5, (Object)null))
            {
                Text component = (Text)((Component)child5).GetComponent <Text>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.set_text(LocalizedText.Get("sys.TOWER_RANK_LBL_LV") + param.lv.ToString());
                }
            }
            if (isSpeed)
            {
                Transform child6 = ((Component)child1).get_transform().FindChild("speed");
                if (Object.op_Inequality((Object)child6, (Object)null))
                {
                    Transform child7 = ((Component)child6).get_transform().FindChild("speed_cnt");
                    if (Object.op_Inequality((Object)child7, (Object)null))
                    {
                        Text component = (Text)((Component)child7).GetComponent <Text>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.set_text(param.score.ToString());
                        }
                    }
                    ((Component)child6).get_gameObject().SetActive(true);
                }
                string    rank   = instance.ConvertTowerScoreToRank(tower, param.score, TOWER_SCORE_TYPE.TURN);
                Transform child8 = ((Component)child1).get_transform().FindChild("score_img");
                if (!Object.op_Inequality((Object)child8, (Object)null))
                {
                    return;
                }
                Image component1 = (Image)((Component)child8).GetComponent <Image>();
                if (!Object.op_Inequality((Object)component1, (Object)null))
                {
                    return;
                }
                component1.set_sprite(this.mSheet.GetSprite(rank));
            }
            else
            {
                Transform child6 = ((Component)child1).get_transform().FindChild("tech");
                if (Object.op_Inequality((Object)child6, (Object)null))
                {
                    Transform child7 = ((Component)child6).get_transform().FindChild("tech_cnt");
                    if (Object.op_Inequality((Object)child7, (Object)null))
                    {
                        Text component = (Text)((Component)child7).GetComponent <Text>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.set_text(param.score.ToString());
                        }
                    }
                    ((Component)child6).get_gameObject().SetActive(true);
                }
                string    rank   = instance.ConvertTowerScoreToRank(tower, param.score, TOWER_SCORE_TYPE.DIED);
                Transform child8 = ((Component)child1).get_transform().FindChild("score_img");
                if (!Object.op_Inequality((Object)child8, (Object)null))
                {
                    return;
                }
                Image component1 = (Image)((Component)child8).GetComponent <Image>();
                if (!Object.op_Inequality((Object)component1, (Object)null))
                {
                    return;
                }
                component1.set_sprite(this.mSheet.GetSprite(rank));
            }
        }