示例#1
0
        public void SetupActivityView(WeekDayActivityDataItem activityData, MonoActivityInfoPanel infoPanel, List <LevelDataItem> levels, Transform levelScrollTrans, LevelBtnClickCallBack OnLevelClick, Transform bgTrans, Dictionary <LevelDataItem, Transform> levelTransDict)
        {
            this._activityDatta = activityData;
            this._infoPanel     = infoPanel;
            this._bgTrans       = bgTrans;
            this.InitCache();
            this._selectedGameObject.SetActive(true);
            this._unselectedGameObject.SetActive(true);
            this._hideGameObject.SetActive(false);
            this._imageGameObject.SetActive(true);
            if (!string.IsNullOrEmpty(activityData.GetSmallImgPath()))
            {
                this._imageImage.sprite = Miscs.GetSpriteByPrefab(activityData.GetSmallImgPath());
            }
            this._descText.text = activityData.GetActitityTitle();
            Transform transform = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(((activityData == null) || (activityData.GetStatus() != ActivityDataItemBase.Status.InProgress)) ? "UI/Menus/Widget/Map/LevelPanelActivity" : activityData.GetLevelPanelPath(), BundleType.RESOURCE_FILE)).transform;

            transform.SetParent(levelScrollTrans.Find("Content"), false);
            transform.GetComponent <MonoLevelPanel>().SetupView(levels, OnLevelClick, levelTransDict, activityData, 0);
            base.transform.GetComponent <MonoItemStatus>().isValid = true;
            transform.GetComponent <MonoItemStatus>().isValid      = true;
            this._bgTrans.gameObject.SetActive(true);
            if (this._activityDatta != null)
            {
                this._preImage.sprite  = Miscs.GetSpriteByPrefab(this._activityDatta.GetBgImgPath());
                this._postImage.sprite = Miscs.GetSpriteByPrefab(this._activityDatta.GetBgImgPath());
                this._infoPanel.SetupView(this._activityDatta);
            }
        }