Пример #1
0
        private bool SetupRank()
        {
            EndlessModule instance   = Singleton <EndlessModule> .Instance;
            int           groupLevel = (int)instance.endlessData.get_group_level();

            if (this._viewStatus == ViewStatus.ShowTopGroup)
            {
                groupLevel = instance.TopGroupLevel;
            }
            base.view.transform.gameObject.GetComponent <Animator>().SetBool("IsInTopGroup", groupLevel == instance.TopGroupLevel);
            EndlessGroupMetaData endlessGroupMetaDataByKey = EndlessGroupMetaDataReader.GetEndlessGroupMetaDataByKey(groupLevel);

            base.view.transform.Find("GroupPanel/RankPanel/GroupName/GroupName").GetComponent <Text>().text     = LocalizationGeneralLogic.GetText(endlessGroupMetaDataByKey.groupName, new object[0]);
            base.view.transform.Find("GroupPanel/RankPanel/GroupName/GroupName").GetComponent <Text>().color    = this._groupColor;
            base.view.transform.Find("GroupPanel/RankPanel/BracketTop/Line").GetComponent <Image>().color       = this._groupColor;
            base.view.transform.Find("GroupPanel/RankPanel/BracketTop/LineCur").GetComponent <Image>().color    = this._groupColor;
            base.view.transform.Find("GroupPanel/RankPanel/BracketBottom/Line").GetComponent <Image>().color    = this._groupColor;
            base.view.transform.Find("GroupPanel/RankPanel/BracketBottom/LineCur").GetComponent <Image>().color = this._groupColor;
            int       num2      = 0;
            int       count     = 0;
            Transform transform = base.view.transform.Find("GroupPanel/RankPanel/RankList/Content/PromoteRank");

            if (endlessGroupMetaDataByKey.promoteRank == 0)
            {
                transform.gameObject.SetActive(false);
            }
            else
            {
                transform.gameObject.SetActive(true);
                List <int> promoteRank = instance.GetPromoteRank(this._viewStatus);
                transform.Find("RankRewardRow/Title").GetComponent <Text>().text = (instance.currentGroupLevel != instance.endlessData.get_cur_top_group_level()) ? LocalizationGeneralLogic.GetText("Menu_Title_EndlessPromoteArea", new object[0]) : LocalizationGeneralLogic.GetText("Menu_Title_EndlessStayArea", new object[0]);
                count = promoteRank.Count;
                transform.GetComponent <MonoRank>().SetupView(num2 + 1, endlessGroupMetaDataByKey.prototeRewardID, promoteRank, this._viewStatus);
                num2 += count;
            }
            transform = base.view.transform.Find("GroupPanel/RankPanel/RankList/Content/NormalRank");
            List <int> normalRank = instance.GetNormalRank(this._viewStatus);

            count = normalRank.Count;
            transform.GetComponent <MonoRank>().SetupView(num2 + 1, endlessGroupMetaDataByKey.normalRewardID, normalRank, this._viewStatus);
            num2     += count;
            transform = base.view.transform.Find("GroupPanel/RankPanel/RankList/Content/DemoteRank");
            if (endlessGroupMetaDataByKey.groupLevel > 1)
            {
                transform.gameObject.SetActive(true);
                List <int> demoteRank = instance.GetDemoteRank(this._viewStatus);
                count = demoteRank.Count;
                transform.GetComponent <MonoRank>().SetupView(num2 + 1, endlessGroupMetaDataByKey.demoteRewardID, demoteRank, this._viewStatus);
            }
            else
            {
                transform.gameObject.SetActive(false);
            }
            return(false);
        }
Пример #2
0
 private void SetupViewForTryOrDebugLevel()
 {
     base.view.transform.Find("Dialog/StatusTab/Content/Title/Text").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_TrySkill", new object[0]);
     base.view.transform.Find("Dialog/StatusTab/Content/CurrentGetItems").gameObject.SetActive(false);
     base.view.transform.Find("Dialog/StatusTab/Content/ChallengePanel").gameObject.SetActive(false);
     base.view.transform.Find("Dialog/StatusTab/Content/Pause").gameObject.SetActive(true);
     if (Singleton <LevelScoreManager> .Instance.LevelType == 4)
     {
         EndlessGroupMetaData data = EndlessGroupMetaDataReader.TryGetEndlessGroupMetaDataByKey(Singleton <EndlessModule> .Instance.currentGroupLevel);
         base.view.transform.Find("Dialog/StatusTab/Content/Title/Text").GetComponent <Text>().text = LocalizationGeneralLogic.GetText(data.groupName, new object[0]);
     }
 }
Пример #3
0
        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);
        }
Пример #4
0
        private void DoBeginLevel()
        {
            Singleton <LevelScoreManager> .Create();

            int progress = !this._stageBeginRsp.get_progressSpecified() ? 1 : (((int)this._stageBeginRsp.get_progress()) + 1);

            this._groupMetaData = EndlessGroupMetaDataReader.GetEndlessGroupMetaDataByKey(Singleton <EndlessModule> .Instance.currentGroupLevel);
            int           hardLevel       = Mathf.FloorToInt(this._groupMetaData.baseHardLevel + ((progress - 1) * this._groupMetaData.deltaHardLevel));
            List <string> appliedToolList = new List <string>();

            foreach (uint num3 in this._stageBeginRsp.get_effect_item_id_list())
            {
                EndlessToolDataItem item = new EndlessToolDataItem((int)num3, 1);
                if (item.ParamString != null)
                {
                    appliedToolList.Add(item.ParamString);
                }
            }
            Singleton <LevelScoreManager> .Instance.SetEndlessLevelBeginIntent(progress, hardLevel, appliedToolList, this._stageBeginRsp, MiscData.Config.BasicConfig.EndlessInitTimer, 1);

            this.ResetWaitPacketData();
            Singleton <MainUIManager> .Instance.MoveToNextScene("TestLevel01", false, true, true, null, true);
        }
Пример #5
0
        private void DoSetupView()
        {
            base.view.transform.Find("GroupPanel").gameObject.SetActive(true);
            this.InitAnimationAndDialogManager();
            Transform transform = base.view.transform.Find("GroupPanel/GroupInfotPanel");

            transform.Find("GroupName").GetComponent <Text>().text = LocalizationGeneralLogic.GetText(EndlessGroupMetaDataReader.GetEndlessGroupMetaDataByKey(Singleton <EndlessModule> .Instance.currentGroupLevel).groupName, new object[0]);
            Color color  = Miscs.ParseColor(MiscData.Config.EndlessGroupUnSelectColor[Singleton <EndlessModule> .Instance.currentGroupLevel]);
            Color color2 = Miscs.ParseColor(MiscData.Config.EndlessGroupBGColor[Singleton <EndlessModule> .Instance.currentGroupLevel]);

            transform.Find("GroupName").GetComponent <Text>().color = color;
            base.view.transform.Find("BG/GroupColor").GetComponent <Image>().color = color2;
            int currentFinishProgress = Singleton <EndlessModule> .Instance.CurrentFinishProgress;

            transform.Find("FloorNum").GetComponent <Text>().text = (currentFinishProgress != 0) ? currentFinishProgress.ToString() : "-";
            base.view.transform.Find("GroupPanel/Result/Win").gameObject.SetActive(this.isSuccess);
            base.view.transform.Find("GroupPanel/Result/Lost").gameObject.SetActive(!this.isSuccess);
            if (!this.isSuccess)
            {
                base.view.transform.Find("BG/TriangleFill").GetComponent <Image>().material = Miscs.LoadResource <Material>("Material/ImageGrayscale", BundleType.RESOURCE_FILE);
                base.view.transform.Find("BG").GetComponent <Image>().material = Miscs.LoadResource <Material>("Material/ImageGrayscale", BundleType.RESOURCE_FILE);
            }
            else
            {
                base.view.transform.Find("BG/TriangleFill").GetComponent <Image>().material = null;
                base.view.transform.Find("BG").GetComponent <Image>().material = null;
            }
            this.SetupReward();
            this._dropItemAnimationManager.StartPlay(0f, true);
        }
Пример #6
0
        private void SetupRewardTilte()
        {
            base.view.transform.Find("Dialog/Content/Title/GradientMask/Gradient").GetComponent <Gradient>().topColor = this._groupBGColor;
            base.view.transform.Find("Dialog/Content/GroupPanel/GroupBGL").GetComponent <Image>().color = this._groupBGColor;
            base.view.transform.Find("Dialog/Content/GroupPanel/GroupName").GetComponent <Text>().text  = LocalizationGeneralLogic.GetText(EndlessGroupMetaDataReader.GetEndlessGroupMetaDataByKey((int)this._rewardData.get_group_level()).groupName, new object[0]);
            switch (this._rewardData.get_reward_type())
            {
            case 1:
                base.view.transform.Find("Dialog/Content/Title/MainTitle").GetComponent <Text>().text  = LocalizationGeneralLogic.GetText("Menu_Desc_EndlessPromoteTitle", new object[0]);
                base.view.transform.Find("Dialog/Content/Title/SubTitle").GetComponent <Text>().text   = LocalizationGeneralLogic.GetText("Menu_Desc_EndlessPromoteSubtitle", new object[0]);
                base.view.transform.Find("Dialog/Content/GroupPanel/Label").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_Title_EndlessPromote", new object[0]);
                break;

            case 2:
                base.view.transform.Find("Dialog/Content/Title/MainTitle").GetComponent <Text>().text  = LocalizationGeneralLogic.GetText("Menu_Desc_EndlessStayTitle", new object[0]);
                base.view.transform.Find("Dialog/Content/Title/SubTitle").GetComponent <Text>().text   = LocalizationGeneralLogic.GetText("Menu_Desc_EndlessStaySubtitle", new object[0]);
                base.view.transform.Find("Dialog/Content/GroupPanel/Label").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_Title_EndlessStay", new object[0]);
                break;

            case 3:
                base.view.transform.Find("Dialog/Content/Title/MainTitle").GetComponent <Text>().text  = LocalizationGeneralLogic.GetText("Menu_Desc_EndlessDemoteTitle", new object[0]);
                base.view.transform.Find("Dialog/Content/Title/SubTitle").GetComponent <Text>().text   = LocalizationGeneralLogic.GetText("Menu_Desc_EndlessDemoteSubtitle", new object[0]);
                base.view.transform.Find("Dialog/Content/GroupPanel/Label").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_Title_EndlessDemote", new object[0]);
                break;
            }
        }
Пример #7
0
        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();
            }
        }