private void SetupTitleView(WeekDayActivityDataItem activityData) { bool flag = activityData.GetStatus() == ActivityDataItemBase.Status.InProgress; this._normalGameObject.SetActive(flag); this._greyGameObject.SetActive(!flag); }
public void SetupView(List <LevelDataItem> levels, LevelBtnClickCallBack OnLevelClick, Dictionary <LevelDataItem, Transform> levelTransDict, WeekDayActivityDataItem activityData = null, int totalFinishChallengeNum = 0) { if ((activityData == null) || (activityData.GetStatus() == ActivityDataItemBase.Status.InProgress)) { foreach (LevelDataItem item in levels) { Transform parent = base.transform.Find(item.SectionId.ToString()); Transform transform = UnityEngine.Object.Instantiate <GameObject>(this.level).transform; transform.SetParent(parent, false); int num = 1; StageType levelType = item.LevelType; if (((levelType == 2) || (levelType == 3)) && (activityData != null)) { num = activityData.maxEnterTimes - activityData.enterTimes; } transform.GetComponent <MonoLevelView>().SetupView(item, num > 0, OnLevelClick, totalFinishChallengeNum); if (item.LevelType == 1) { levelTransDict.Add(item, transform); } } } else { base.transform.Find("Icon/Desc").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ActivityStatusImgPath[(int)activityData.GetStatus()]); } }
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); } }