|
@@ -16,18 +16,35 @@ namespace GFGGame
|
|
|
private GObject _unPasslevelItem;
|
|
|
private GObject _endLevelItem;
|
|
|
private EffectUI _effectUI1;
|
|
|
+ private EffectUI _effectUI2;
|
|
|
private GComponent _comEff;
|
|
|
+ private GComponent _effFirst;
|
|
|
+
|
|
|
+ //当前章节索引
|
|
|
+ private int newIndex;
|
|
|
+ //y轴移动索引
|
|
|
+ private float indexY;
|
|
|
+ private GameObject gamey;
|
|
|
+ //特效类型数组,这里后面可以二维数组,放向左和向右的
|
|
|
+ private string[] effArray = new string[2]{ "ZJ_JuQing","ZJ_ZD" };
|
|
|
|
|
|
private int currentDifficulty;
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
EffectUIPool.Recycle(_effectUI1);
|
|
|
_effectUI1 = null;
|
|
|
+ EffectUIPool.Recycle(_effectUI2);
|
|
|
+ _effectUI2 = null;
|
|
|
if (_comEff != null)
|
|
|
{
|
|
|
_comEff.RemoveFromParent();
|
|
|
_comEff.Dispose();
|
|
|
}
|
|
|
+ if (_effFirst != null)
|
|
|
+ {
|
|
|
+ _effFirst.RemoveFromParent();
|
|
|
+ _effFirst.Dispose();
|
|
|
+ }
|
|
|
if (_valueBarController != null)
|
|
|
{
|
|
|
_valueBarController.Dispose();
|
|
@@ -47,7 +64,7 @@ namespace GFGGame
|
|
|
_ui = UI_StoryChapterUI.Create();
|
|
|
viewCom = _ui.target;
|
|
|
isfullScreen = true;
|
|
|
- isReturnView = true;
|
|
|
+ isReturnView = false;
|
|
|
}
|
|
|
|
|
|
protected override void OnInit()
|
|
@@ -76,6 +93,10 @@ namespace GFGGame
|
|
|
_comEff = new GComponent();
|
|
|
_comEff = UIPackage.CreateObject(UI_MainUI.PACKAGE_NAME, "ComEff").asCom;
|
|
|
_effectUI1 = EffectUIPool.CreateEffectUI(_comEff.GetChild("holder").asGraph, "ui_gk", "ui_gk_sg");
|
|
|
+
|
|
|
+ _effFirst = new GComponent();
|
|
|
+ _effFirst = UIPackage.CreateObject(UI_MainUI.PACKAGE_NAME, "ComEff").asCom;
|
|
|
+
|
|
|
}
|
|
|
protected override void AddEventListener()
|
|
|
{
|
|
@@ -97,8 +118,23 @@ namespace GFGGame
|
|
|
}
|
|
|
MainStoryDataManager.currentChapterCfgId = _chapterID;
|
|
|
|
|
|
+ //由于这里会切换特效,所以切换界面时进行清空
|
|
|
+ EffectUIPool.Recycle(_effectUI2);
|
|
|
+ _effectUI2 = null;
|
|
|
+ if (_effFirst != null)
|
|
|
+ {
|
|
|
+ _effFirst.RemoveFromParent();
|
|
|
+ }
|
|
|
+
|
|
|
+ StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID);
|
|
|
+ newIndex = StoryUtil.GetChapterOrder(chapterCfg.id);
|
|
|
+ indexY = 115.0f * (float)StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(chapterCfg.type, chapterCfg.subType, chapterCfg.id).Count;
|
|
|
+ gamey = GameObject.Find("Stage/GRoot/GComponent/StoryChapterUI/CompChapter/Container/Container");
|
|
|
+
|
|
|
Timers.inst.StartCoroutine(InitChapter());
|
|
|
|
|
|
+ Timers.inst.Add(0.5f,1,SetContainerY);
|
|
|
+
|
|
|
_valueBarController.OnShown();
|
|
|
|
|
|
_ui.target.touchable = true;
|
|
@@ -114,7 +150,6 @@ namespace GFGGame
|
|
|
{
|
|
|
_ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = true;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -124,7 +159,7 @@ namespace GFGGame
|
|
|
_endLevelItem = null;
|
|
|
// _ui.m_chapter.RemoveChildren(0, 0, true);
|
|
|
_valueBarController.OnHide();
|
|
|
-
|
|
|
+ Timers.inst.Remove(SetContainerY);
|
|
|
Timers.inst.Remove(CheckGuide);
|
|
|
}
|
|
|
|
|
@@ -141,7 +176,8 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickSwitchBack()
|
|
|
{
|
|
|
- ViewManager.Show<StoryChapterListView>( null, new object[] { typeof(StoryChapterView).FullName, this.viewData });
|
|
|
+ Timers.inst.Remove(SetContainerY);
|
|
|
+ ViewManager.Show<StoryChapterListView>(new object[] { currentDifficulty , newIndex }, new object[] { typeof(StoryChapterView).FullName, this.viewData });
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnHome()
|
|
@@ -153,6 +189,7 @@ namespace GFGGame
|
|
|
{
|
|
|
if (MainStoryDataManager.CheckChapterUnlock(_chapterID+1))
|
|
|
{
|
|
|
+ Timers.inst.Remove(SetContainerY);
|
|
|
ViewManager.Show<StoryChapterView>(new object[] { _chapterID+1, currentDifficulty });
|
|
|
}
|
|
|
else
|
|
@@ -185,12 +222,15 @@ namespace GFGGame
|
|
|
int lineGap = 4500 / list.Count;
|
|
|
|
|
|
_comEff.visible = false;
|
|
|
+ _effFirst.visible = false;
|
|
|
for (int i = 0; i < 20; i++)
|
|
|
{
|
|
|
GObject obj = _ui.m_chapter.m_compChapterScroll.target.GetChild("g" + (19 - i + 1));
|
|
|
obj.SetPosition(obj.x, starPosY - lineGap * i - 300, 0); ;
|
|
|
StoryLevelCfg levelCfg = i < list.Count ? list[i] : null;
|
|
|
UI_CompStoryLevelItem levelItem = UI_CompStoryLevelItem.Proxy(obj);
|
|
|
+ levelItem.m_fightBg.visible = true;
|
|
|
+ levelItem.m_loaDialogBg.visible = true;
|
|
|
if (levelCfg != null && MainStoryDataManager.CheckLevelUnlock(levelCfg.id))
|
|
|
{
|
|
|
UnlockCount++;
|
|
@@ -267,6 +307,23 @@ namespace GFGGame
|
|
|
_unPasslevelItem = levelItem.target;
|
|
|
levelItem.target.AddChild(_comEff);
|
|
|
_comEff.visible = true;
|
|
|
+
|
|
|
+ //设置解锁特效
|
|
|
+ //string effName;
|
|
|
+ //if ( currentDifficulty == 0 )
|
|
|
+ //{
|
|
|
+ // effName = effArray[levelItem.m_c1.selectedIndex];
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // effName = effArray[levelItem.m_c1.selectedIndex] + "_Blue";
|
|
|
+ //}
|
|
|
+ //_effectUI2 = EffectUIPool.CreateEffectUI(_effFirst.GetChild("holder").asGraph, "ui_zj", effName);
|
|
|
+ //levelItem.target.AddChild(_effFirst);
|
|
|
+ //levelItem.m_fightBg.visible = false;
|
|
|
+ //levelItem.m_loaDialogBg.visible = false;
|
|
|
+ //_effFirst.visible = true;
|
|
|
+ //Timers.inst.Add(1.7f, 1, HideEffect, obj);
|
|
|
}
|
|
|
if (levelCfg.order > endLevel)
|
|
|
{
|
|
@@ -281,8 +338,21 @@ namespace GFGGame
|
|
|
UI_CompStoryLevelItem.ProxyEnd();
|
|
|
}
|
|
|
yield return new WaitForEndOfFrame();
|
|
|
- _ui.m_chapter.m_compChapterScroll.target.y = Mathf.Max(0, _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height);
|
|
|
|
|
|
+ _ui.m_chapter.m_compChapterScroll.target.y =Mathf.Max(1 , _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height);
|
|
|
+ gamey.transform.position = new Vector3(0, indexY, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void SetContainerY(object param = null)
|
|
|
+ {
|
|
|
+ _ui.m_chapter.m_compChapterScroll.target.y = Mathf.Max(0, _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void HideEffect(object param = null)
|
|
|
+ {
|
|
|
+ //UI_CompStoryLevelItem.Proxy(param as GObject).m_fightBg.visible = true;
|
|
|
+ _comEff.visible = true;
|
|
|
+ //_effFirst.visible = false;
|
|
|
}
|
|
|
|
|
|
private void OnClickLevelItem(EventContext context)
|