コード例 #1
0
        private void SetupTitle()
        {
            this._levelSuccess = Singleton <LevelScoreManager> .Instance.endStatus == 1;
            this._levelData    = Singleton <LevelModule> .Instance.GetLevelById(Singleton <LevelScoreManager> .Instance.LevelId);

            if (this._levelData == null)
            {
                base.view.transform.Find("Title/LevelInfo").gameObject.SetActive(false);
            }
            else
            {
                base.view.transform.Find("Title/LevelInfo").gameObject.SetActive(true);
                switch (this._levelData.LevelType)
                {
                case 1:
                {
                    ActDataItem item = new ActDataItem(this._levelData.ActID);
                    base.view.transform.Find("Title/LevelInfo/ActName").GetComponent <Text>().text = item.actTitle + " " + item.actName;
                    break;
                }

                case 2:
                case 3:
                    base.view.transform.Find("Title/LevelInfo/ActName").GetComponent <Text>().text = Singleton <LevelModule> .Instance.GetWeekDayActivityByID(this._levelData.ActID).GetActitityTitle();

                    break;
                }
                base.view.transform.Find("Title/LevelInfo/LevelName").GetComponent <Text>().text = this._levelData.Title;
            }
        }
コード例 #2
0
ファイル: MonoActButton.cs プロジェクト: slb1988/agame
        public void SetupActView(ActDataItem actData, List <LevelDataItem> levels, Transform levelScrollTrans, LevelBtnClickCallBack OnLevelClick, Transform bgTrans, Dictionary <LevelDataItem, Transform> levelTransDict, int totalFinishChallengeNum)
        {
            this._actData = actData;
            this._bgTrans = bgTrans;
            this.InitCache();
            this._selectedGameObject.SetActive(true);
            this._unselectedGameObject.SetActive(true);
            this._hideGameObject.SetActive(false);
            this._imageGameObject.SetActive(true);
            if (!string.IsNullOrEmpty(actData.smallImgPath))
            {
                this._imageImage.sprite = Miscs.GetSpriteByPrefab(actData.smallImgPath);
            }
            this._descText.text = actData.actTitle;
            Transform transform = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(actData.levelPanelPath, BundleType.RESOURCE_FILE)).transform;

            transform.SetParent(levelScrollTrans.Find("Content"), false);
            transform.GetComponent <MonoLevelPanel>().SetupView(levels, OnLevelClick, levelTransDict, null, totalFinishChallengeNum);
            base.transform.GetComponent <MonoItemStatus>().isValid = true;
            transform.GetComponent <MonoItemStatus>().isValid      = true;
            this._bgTrans.gameObject.SetActive(true);
            if (actData != null)
            {
                this._preImage.sprite       = this._bgImgSprite;
                this._preCanvasGroup.alpha  = 1f;
                this._postImage.sprite      = this._bgImgSprite;
                this._postCanvasGroup.alpha = 1f;
            }
        }
コード例 #3
0
        private void SetupProfile()
        {
            Transform transform = base.view.transform.Find("Profile");

            switch (this.levelData.LevelType)
            {
            case 1:
            {
                ActDataItem item = new ActDataItem(this.levelData.ActID);
                transform.Find("Title/Desc").GetComponent <Text>().text = item.actTitle + " " + item.actName;
                break;
            }

            case 2:
            case 3:
                transform.Find("Title/Desc").GetComponent <Text>().text = Singleton <LevelModule> .Instance.GetWeekDayActivityByID(this.levelData.ActID).GetActitityTitle();

                break;
            }
            transform.Find("Title/Desc").GetComponent <TypewriterEffect>().RestartRead();
            transform.Find("Pic/LevelName").gameObject.SetActive(false);
            transform.Find("Pic/LevelName").GetComponent <Text>().text = this.levelData.StageName;
            transform.Find("Pic/Icon").GetComponent <Image>().sprite   = this.levelData.GetDetailPicSprite();
            transform.Find("Info/Text").GetComponent <Text>().text     = this.levelData.Desc;
            transform.Find("Info/Text").GetComponent <TypewriterEffect>().RestartRead();
        }