Exemple #1
0
        public void SetUpExploreCanvas(int gameLevelIndex, string gameLevelLocation)
        {
            unlockScrollDetail.InitUnlockScrollDetailHUD(true, null, UnlockItemCallBack, ResolveScrollCallBack);
            craftingRecipesDetail.InitCraftingRecipesHUD(true, UpdateBottomBar, CraftItemCallBack);
            npcUIController.InitNPCHUD(gameLevelIndex);
            pauseHUD.InitPauseHUD(true, null, null, null, null);

            if (!GameManager.Instance.UIManager.UIDic.ContainsKey("BagCanvas"))
            {
                GameManager.Instance.UIManager.SetUpCanvasWith(CommonData.bagCanvasBundleName, "BagCanvas", () => {
                    Transform bagCanvas = TransformManager.FindTransform("BagCanvas");
                    bagCanvas.GetComponent <BagViewController> ().SetUpBagView(false);
                }, true, true);
            }

            string gameLevelInCurrentLocation = MyTool.NumberToChinese(gameLevelIndex % 5 + 1);

            gameLevelLocationText.text = string.Format("{0}  第 {1} 层", gameLevelLocation, gameLevelInCurrentLocation);

            bpUICtr.InitExploreAgentView();
            bpUICtr.SetUpExplorePlayerView(Player.mainPlayer);
            bmUICtr.InitExploreAgentView();

            GetComponent <Canvas> ().enabled = true;
        }
        public void SetUpChapterSelectPlane()
        {
            int maxUnlockChapterIndex = Player.mainPlayer.maxUnlockLevelIndex / 5;

            for (int i = 0; i < chapterButtons.Length; i++)
            {
                Button chapterButton = chapterButtons [i];

                Text chapterNameText = chapterButton.GetComponentInChildren <Text> ();

                if (i <= maxUnlockChapterIndex)
                {
                    chapterButton.interactable = true;

                    string chapterName = GameManager.Instance.gameDataCenter.gameLevelDatas [5 * i].chapterName;

                    string chapterIndexInChinese = MyTool.NumberToChinese(i + 1);

                    string fullName = string.Format("第{0}章  {1}", chapterIndexInChinese, chapterName);

                    chapterNameText.text = fullName;
                }
                else
                {
                    chapterButton.interactable = false;
                    chapterNameText.text       = "? ? ? ?";
                }
            }

            chaptersContainer.localScale = new Vector3(0.1f, 0.1f, 1);

            chapterSelectPlane.gameObject.SetActive(true);

            IEnumerator chapterSelectZoomInCoroutine = ChapterSelectHUDZoomIn();

            StartCoroutine(chapterSelectZoomInCoroutine);
        }