Beispiel #1
0
        // Token: 0x0600966A RID: 38506 RVA: 0x002B0BAC File Offset: 0x002AEDAC
        public void LoadHeroTeam(int rank)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_LoadHeroTeamInt32_hotfix != null)
            {
                this.m_LoadHeroTeamInt32_hotfix.call(new object[]
                {
                    this,
                    rank
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            this.m_herosRGameObject.SetActive(false);
            this.m_herosSRGameObject.SetActive(false);
            this.m_herosSSRGameObject.SetActive(false);
            GameObject teamGameObject = null;

            if (rank != 4)
            {
                if (rank != 3)
                {
                    if (rank == 2)
                    {
                        teamGameObject = this.m_herosRGameObject;
                    }
                }
                else
                {
                    teamGameObject = this.m_herosSRGameObject;
                }
            }
            else
            {
                teamGameObject = this.m_herosSSRGameObject;
            }
            if (teamGameObject == null)
            {
                return;
            }
            this.m_task.CustomLoadAsset(delegate
            {
                IConfigDataLoader configDataLoader = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
                IEnumerable <KeyValuePair <int, ConfigDataHeroInfo> > allConfigDataHeroInfo = configDataLoader.GetAllConfigDataHeroInfo();
                for (int i = 0; i < teamGameObject.transform.childCount; i++)
                {
                    Transform child = teamGameObject.transform.GetChild(i);
                    ConfigDataHeroInfo configDataHeroInfo = null;
                    foreach (KeyValuePair <int, ConfigDataHeroInfo> keyValuePair in allConfigDataHeroInfo)
                    {
                        if (keyValuePair.Value.Useable && keyValuePair.Value.Name_Eng == child.name)
                        {
                            configDataHeroInfo = keyValuePair.Value;
                            break;
                        }
                    }
                    if (configDataHeroInfo != null)
                    {
                        ConfigDataCharImageInfo charImageInfo = configDataHeroInfo.GetCharImageInfo(configDataHeroInfo.Star);
                        if (charImageInfo != null)
                        {
                            this.m_task.CollectAssetWrap(charImageInfo.HeroPainting);
                        }
                    }
                }
            }, delegate
            {
                this.m_heroShowComponent = new HeroShowComponent();
                this.m_heroShowComponent.Init(teamGameObject);
            });
        }