|
@@ -45,6 +45,9 @@ namespace GFGGame
|
|
|
_ui.m_listType.selectedIndex = 0;
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zxian_bg3");
|
|
|
|
|
|
+ _ui.m_listChapter.scrollPane.onScroll.Add(DoSpecialEffect);//滚动时派发事件
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
@@ -59,8 +62,11 @@ namespace GFGGame
|
|
|
_ui.m_listType.selectedIndex = subType;
|
|
|
_ui.m_listChapter.touchable = false;
|
|
|
UpdateList();
|
|
|
+ DoSpecialEffect();//初始化调用
|
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
|
_ui.m_openViewAction.Play();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -101,7 +107,7 @@ namespace GFGGame
|
|
|
StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterID);
|
|
|
if (MainStoryDataManager.CheckChapterUnlock(chapterID))
|
|
|
{
|
|
|
- ViewManager.Show<StoryChapterView>(chapterID, new object[] { typeof(StoryChapterListView).FullName, new object[] { _ui.m_listType.selectedIndex } });
|
|
|
+ ViewManager.Show<StoryChapterView>(new object[] { chapterID , _ui.m_listType.selectedIndex }, new object[] { typeof(StoryChapterListView).FullName, new object[] { _ui.m_listType.selectedIndex } });
|
|
|
this.Hide();
|
|
|
}
|
|
|
else
|
|
@@ -113,6 +119,36 @@ namespace GFGGame
|
|
|
private void ListChapterItem(int index, GObject item)
|
|
|
{
|
|
|
UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(item);
|
|
|
+ if (subType == 1)
|
|
|
+ {
|
|
|
+ listItem.m_content.m_numBg.url = "ui://Main/zxian_jindu_bg_jy";
|
|
|
+ listItem.m_content.m_txtBG.url = "ui://Main/zxian_chapter_dec_jy";
|
|
|
+ listItem.m_content.m_compPic.m_bg.url = "ui://Main/zxian_chapter_frame_l_jy";
|
|
|
+ listItem.m_content.m_txtChapterName0.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapterName1.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapterName2.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapterName3.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapterName4.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapter.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
|
|
|
+ //listItem.m_content.m_txtCurProgress.color = new Color(0.592f, 0.773f, 0.961f, 1.000f);
|
|
|
+ //listItem.m_content.m_txtMaxProgress.color = new Color(0.592f, 0.773f, 0.961f, 1.000f);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ listItem.m_content.m_numBg.url = "ui://Main/zxian_jindu_bg";
|
|
|
+ listItem.m_content.m_txtBG.url = "ui://Main/zxian_chapter_dec";
|
|
|
+ listItem.m_content.m_compPic.m_bg.url = "ui://Main/zxian_chapter_frame_l";
|
|
|
+ listItem.m_content.m_txtChapterName0.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapterName1.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapterName2.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapterName3.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapterName4.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
|
|
|
+ listItem.m_content.m_txtChapter.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
|
|
|
+ //listItem.m_content.m_txtCurProgress.color = new Color(0.514f, 0.345f, 0.220f, 1.000f);
|
|
|
+ //listItem.m_content.m_txtMaxProgress.color = new Color(0.514f, 0.345f, 0.220f, 1.000f);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// if (index % 2 == 0)
|
|
|
// {
|
|
|
// listItem.m_content.target.y = 102;
|
|
@@ -258,5 +294,33 @@ namespace GFGGame
|
|
|
GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.STUDIO_PORCELAIN, 1, "点击返回主界面。");
|
|
|
GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.STUDIO_FILING, 1, "点击返回主界面。");
|
|
|
}
|
|
|
+
|
|
|
+ private void DoSpecialEffect()
|
|
|
+ {
|
|
|
+ float listCenter = _ui.m_listChapter.scrollPane.posX + _ui.m_listChapter.viewWidth / 2;
|
|
|
+ float listLeft = _ui.m_listChapter.scrollPane.posX + _ui.m_listChapter.viewWidth / 2; ;
|
|
|
+ //list组件的x值,加上list组件自身宽度的一半,设置为对标的中心x值
|
|
|
+ for (int i = 0; i < _ui.m_listChapter.numChildren; i++)
|
|
|
+ {
|
|
|
+ GObject item = _ui.m_listChapter.GetChildAt(i);
|
|
|
+ float itemCenter = item.x + item.width / 2;//循环列表内元素的中心x值
|
|
|
+ float itemWidth = item.width;//列表元素的宽度
|
|
|
+ float distance = Mathf.Abs(listCenter - itemCenter);
|
|
|
+ if (distance < item.width)
|
|
|
+ {
|
|
|
+ float distanceRange = 1 + (1 - distance / itemWidth) * 0.25f;//使放大动画有渐进效果
|
|
|
+ item.SetScale(distanceRange, distanceRange);//设置放大比例
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ item.SetScale(1.0f, 1.0f);
|
|
|
+ }
|
|
|
+ float distanceX = ((1-(listCenter - itemCenter)) / itemWidth) * 0.05f;//使放大动画有渐进效果
|
|
|
+ item.y = - _ui.m_listChapter.height * distanceX;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|