private bool PlayEffect() { string path = string.Empty; int num = (int)this._rewardData.get_group_level(); switch (this._rewardData.get_reward_type()) { case 1: { int count = EndlessGroupMetaDataReader.GetItemList().Count; if (this._rewardData.get_group_level() < (count - 1)) { path = "UI/Menus/Widget/Storage/UpgradingBigSuccess"; num++; break; } path = "UI/Menus/Widget/Storage/UpgradingLargeSuccess"; num = count; break; } case 2: path = "UI/Menus/Widget/Storage/UpgradingBigSuccess"; break; case 3: path = "UI/Menus/Widget/Storage/UpgradingBigSuccess"; if (num > 1) { num--; } break; } UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>(path)).transform.SetParent(base.view.transform, false); base.view.transform.Find("Dialog/Content/GroupPanel/GroupBGL/GroupIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.EndlessGroupSelectPrefabPath[num]); base.view.transform.Find("Btn").gameObject.SetActive(true); return(false); }
private void SetupGroupList() { EndlessModule instance = Singleton <EndlessModule> .Instance; int currentGroupLevel = instance.currentGroupLevel; List <EndlessGroupMetaData> itemList = EndlessGroupMetaDataReader.GetItemList(); Transform transform = base.view.transform.Find("GroupPanel/GroupListPanel/GroupList"); int num2 = (int)instance.endlessData.get_cur_top_group_level(); bool flag = instance.endlessData.get_top_group_player_numSpecified() && instance.endlessData.get_top_group_promote_unlock_player_numSpecified(); float num3 = instance.endlessData.get_top_group_player_num(); float num4 = instance.endlessData.get_top_group_promote_unlock_player_num(); bool flag2 = instance.CanSeeTopGroupInfo(); for (int i = 0; i < transform.childCount; i++) { Transform child = transform.GetChild(i); if (i >= itemList.Count) { child.gameObject.SetActive(false); } else { string str; EndlessGroupMetaData data = itemList[i]; bool flag3 = currentGroupLevel == data.groupLevel; child.Find("CurrentGroup").gameObject.SetActive((this._viewStatus != ViewStatus.ShowCurrentGroup) ? (data.groupLevel == itemList.Count) : flag3); if (data.groupLevel > num2) { str = MiscData.Config.EndlessGroupUnopenPrefabPath[data.groupLevel]; } else if (data.groupLevel == currentGroupLevel) { str = MiscData.Config.EndlessGroupSelectPrefabPath[data.groupLevel]; } else { str = MiscData.Config.EndlessGroupUnselectPrefabPath[data.groupLevel]; } child.Find("Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(str); if (flag2) { Button component = child.Find("Button").GetComponent <Button>(); if (flag3) { component.gameObject.SetActive(true); base.BindViewCallback(component, new UnityAction(this.OnCurrentButtonClick)); } else if (data.groupLevel == instance.TopGroupLevel) { child.Find("Button").GetComponent <Button>().gameObject.SetActive(true); child.Find("Particle").GetComponent <ParticleSystem>().gameObject.SetActive(true); base.BindViewCallback(component, new UnityAction(this.OnTopGroupButtonClick)); } } else if (data.groupLevel == (num2 + 1)) { child.Find("Button").GetComponent <Button>().gameObject.SetActive(true); base.BindViewCallback(child.Find("Button").GetComponent <Button>(), new UnityAction(this.ShowNextGroupHint)); } else { child.Find("Button").GetComponent <Button>().gameObject.SetActive(false); } bool flag4 = data.groupLevel == (num2 + 1); child.Find("Slider").gameObject.SetActive(flag4 && flag); child.Find("Slider/Fill").GetComponent <Image>().fillAmount = num3 / num4; } } if (instance.CanRequestTopGroupInfo()) { Singleton <NetworkManager> .Instance.RequestGetEndlessTopGroup(); } }