|
@@ -11,7 +11,6 @@ namespace GFGGame
|
|
private int curTab;
|
|
private int curTab;
|
|
private int subType = ConstInstanceZonesSubType.Normal;
|
|
private int subType = ConstInstanceZonesSubType.Normal;
|
|
private List<StoryChapterCfg> _chapterCfgs;
|
|
private List<StoryChapterCfg> _chapterCfgs;
|
|
-
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
if (_ui != null)
|
|
if (_ui != null)
|
|
@@ -46,7 +45,8 @@ namespace GFGGame
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zxian_bg3");
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zxian_bg3");
|
|
|
|
|
|
_ui.m_listChapter.scrollPane.onScroll.Add(DoSpecialEffect);//滚动时派发事件
|
|
_ui.m_listChapter.scrollPane.onScroll.Add(DoSpecialEffect);//滚动时派发事件
|
|
-
|
|
|
|
|
|
+ //_ui.m_listChapter.scrollPane.onScroll.Add(SetItemColorCallBack);
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -66,7 +66,7 @@ namespace GFGGame
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
_ui.m_openViewAction.Play();
|
|
_ui.m_openViewAction.Play();
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
@@ -105,19 +105,36 @@ namespace GFGGame
|
|
GObject chapterItem = context.sender as GObject;
|
|
GObject chapterItem = context.sender as GObject;
|
|
int chapterID = (int)chapterItem.data;
|
|
int chapterID = (int)chapterItem.data;
|
|
StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterID);
|
|
StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterID);
|
|
- if (MainStoryDataManager.CheckChapterUnlock(chapterID))
|
|
|
|
|
|
+ //这里变成-1,是因为调整了item,最左右两边现在有item但是是透明没数据的
|
|
|
|
+ int index = chapterCfg.order - 1;
|
|
|
|
+ index = Mathf.Clamp(index, 0, _ui.m_listChapter.numItems - 2);
|
|
|
|
+ int firstChildIndex = _ui.m_listChapter.GetFirstChildInView();
|
|
|
|
+ if (firstChildIndex != index)
|
|
{
|
|
{
|
|
- ViewManager.Show<StoryChapterView>(new object[] { chapterID , _ui.m_listType.selectedIndex }, new object[] { typeof(StoryChapterListView).FullName, new object[] { _ui.m_listType.selectedIndex } });
|
|
|
|
- this.Hide();
|
|
|
|
|
|
+ _ui.m_listChapter.ScrollToView(index, true, true);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+ if (MainStoryDataManager.CheckChapterUnlock(chapterID))
|
|
|
|
+ {
|
|
|
|
+ ViewManager.Show<StoryChapterView>(new object[] { chapterID, _ui.m_listType.selectedIndex }, new object[] { typeof(StoryChapterListView).FullName, new object[] { _ui.m_listType.selectedIndex } });
|
|
|
|
+ this.Hide();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private void ListChapterItem(int index, GObject item)
|
|
private void ListChapterItem(int index, GObject item)
|
|
{
|
|
{
|
|
|
|
+ if (index == 0 || index == _ui.m_listChapter.numItems - 1)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ index -= 1;
|
|
UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(item);
|
|
UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(item);
|
|
if (subType == 1)
|
|
if (subType == 1)
|
|
{
|
|
{
|
|
@@ -148,7 +165,7 @@ namespace GFGGame
|
|
//listItem.m_content.m_txtMaxProgress.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)
|
|
// if (index % 2 == 0)
|
|
// {
|
|
// {
|
|
// listItem.m_content.target.y = 102;
|
|
// listItem.m_content.target.y = 102;
|
|
@@ -187,7 +204,8 @@ namespace GFGGame
|
|
{
|
|
{
|
|
i = _time;
|
|
i = _time;
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
if (_timeCount > _ui.m_listChapter.numChildren)
|
|
if (_timeCount > _ui.m_listChapter.numChildren)
|
|
{
|
|
{
|
|
Timers.inst.Remove(OnTimerUpdate);
|
|
Timers.inst.Remove(OnTimerUpdate);
|
|
@@ -195,23 +213,32 @@ namespace GFGGame
|
|
}
|
|
}
|
|
i = _time - _ui.m_listChapter.numChildren;
|
|
i = _time - _ui.m_listChapter.numChildren;
|
|
}
|
|
}
|
|
- _ui.m_listChapter.GetChildAt(i).visible = true;
|
|
|
|
- UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(_ui.m_listChapter.GetChildAt(i));
|
|
|
|
- listItem.m_openListAction.Play();
|
|
|
|
-
|
|
|
|
|
|
+ if (i > 0 && i < _ui.m_listChapter.numItems - 1)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_listChapter.GetChildAt(i).visible = true;
|
|
|
|
+ UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(_ui.m_listChapter.GetChildAt(i));
|
|
|
|
+ listItem.m_openListAction.Play();
|
|
|
|
+ }
|
|
_time += (int)param;
|
|
_time += (int)param;
|
|
}
|
|
}
|
|
|
|
|
|
private void UpdateList()
|
|
private void UpdateList()
|
|
{
|
|
{
|
|
_chapterCfgs = StoryChapterCfgArray.Instance.GetCfgsBysubType(subType);
|
|
_chapterCfgs = StoryChapterCfgArray.Instance.GetCfgsBysubType(subType);
|
|
- _ui.m_listChapter.numItems = _chapterCfgs.Count;
|
|
|
|
|
|
+ //这里+2,只是为了list左右两边为空白的表现,对于数据没啥意义
|
|
|
|
+ _ui.m_listChapter.numItems = _chapterCfgs.Count + 2;
|
|
int currentChapterIndex = 0;
|
|
int currentChapterIndex = 0;
|
|
- for (int i = 0; i < _ui.m_listChapter.numChildren; i++)
|
|
|
|
|
|
+ for (int i = 0; i < _ui.m_listChapter.numChildren; i++)
|
|
{
|
|
{
|
|
|
|
+ if (i == 0 || i == _ui.m_listChapter.numItems - 1)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_listChapter.GetChildAt(i).visible = false;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(_ui.m_listChapter.GetChildAt(i));
|
|
UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(_ui.m_listChapter.GetChildAt(i));
|
|
|
|
+ int index = i - 1;
|
|
int chapterID = (int)listItem.target.data;
|
|
int chapterID = (int)listItem.target.data;
|
|
- StoryChapterCfg chapterCfg = _chapterCfgs[i];
|
|
|
|
|
|
+ StoryChapterCfg chapterCfg = _chapterCfgs[index];
|
|
int starCountChapter = InstanceZonesDataManager.GetChapterStarCount(chapterCfg.id, chapterCfg.type, chapterCfg.subType);
|
|
int starCountChapter = InstanceZonesDataManager.GetChapterStarCount(chapterCfg.id, chapterCfg.type, chapterCfg.subType);
|
|
listItem.m_content.m_txtCurProgress.text = starCountChapter.ToString();
|
|
listItem.m_content.m_txtCurProgress.text = starCountChapter.ToString();
|
|
listItem.m_content.m_txtMaxProgress.text = chapterCfg.bonusStar3.ToString();
|
|
listItem.m_content.m_txtMaxProgress.text = chapterCfg.bonusStar3.ToString();
|
|
@@ -255,7 +282,8 @@ namespace GFGGame
|
|
{
|
|
{
|
|
_time = currentChapterIndex - 1;
|
|
_time = currentChapterIndex - 1;
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
_time = currentChapterIndex;
|
|
_time = currentChapterIndex;
|
|
}
|
|
}
|
|
_timeCount = 0;
|
|
_timeCount = 0;
|
|
@@ -308,19 +336,30 @@ namespace GFGGame
|
|
float distance = Mathf.Abs(listCenter - itemCenter);
|
|
float distance = Mathf.Abs(listCenter - itemCenter);
|
|
if (distance < item.width)
|
|
if (distance < item.width)
|
|
{
|
|
{
|
|
- float distanceRange = 1 + (1 - distance / itemWidth) * 0.25f;//使放大动画有渐进效果
|
|
|
|
|
|
+ float distanceRange = 1 + (1 - distance / itemWidth) * 0.3f;//使放大动画有渐进效果
|
|
item.SetScale(distanceRange, distanceRange);//设置放大比例
|
|
item.SetScale(distanceRange, distanceRange);//设置放大比例
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ //设置颜色变化
|
|
|
|
+ if (distance < item.width / 2)
|
|
|
|
+ {
|
|
|
|
+ UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(_ui.m_listChapter.GetChildAt(i));
|
|
|
|
+ listItem.m_content.m_compPic.m_pic.color = new Color(1.0f, 1.0f, 1.0f, 1.000f);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(_ui.m_listChapter.GetChildAt(i));
|
|
|
|
+ listItem.m_content.m_compPic.m_pic.color = new Color(0.4f, 0.4f, 0.4f, 1.000f);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+ //设置颜色变化
|
|
|
|
+ UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(_ui.m_listChapter.GetChildAt(i));
|
|
|
|
+ listItem.m_content.m_compPic.m_pic.color = new Color(0.4f, 0.4f, 0.4f, 1.000f);
|
|
item.SetScale(1.0f, 1.0f);
|
|
item.SetScale(1.0f, 1.0f);
|
|
}
|
|
}
|
|
- float distanceX = ((1-(listCenter - itemCenter)) / itemWidth) * 0.05f;//使放大动画有渐进效果
|
|
|
|
- item.y = - _ui.m_listChapter.height * distanceX;
|
|
|
|
|
|
+ float distanceX = ((1 - (listCenter - itemCenter)) / itemWidth) * 0.05f;//使放大动画有渐进效果
|
|
|
|
+ item.y = -_ui.m_listChapter.height * distanceX;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|