|
@@ -29,7 +29,7 @@ namespace GFGGame
|
|
|
private float indexY;
|
|
|
private GameObject gamey;
|
|
|
//特效类型数组,这里后面可以二维数组,放向左和向右的
|
|
|
- private string[] effArray = new string[2]{ "ZJ_JuQing","ZJ_ZD" };
|
|
|
+ private string[] effArray = new string[2] { "ZJ_JuQing", "ZJ_ZD" };
|
|
|
|
|
|
private int currentDifficulty;
|
|
|
public override void Dispose()
|
|
@@ -83,6 +83,7 @@ namespace GFGGame
|
|
|
_ui.m_btnHome.onClick.Add(OnClickBtnHome);
|
|
|
_ui.m_switchChapter.onClick.Add(OnClickSwitchBack);
|
|
|
_ui.m_chapter.m_compChapterScroll.m_imgBegin.onClick.Add(OnClickNext);
|
|
|
+ _ui.m_suitIcon.onClick.Add(OnClickGotoView);
|
|
|
_ui.m_bonusBox1.target.onClick.Add(() =>
|
|
|
{
|
|
|
OnClickBonusBox(_ui.m_bonusBox1, 0);
|
|
@@ -114,6 +115,7 @@ namespace GFGGame
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
+
|
|
|
_ui.target.touchable = false;
|
|
|
SuitFosterProxy.SendGetSuitInfos().Coroutine();
|
|
|
MusicManager.Instance.PlayCroutine(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
|
|
@@ -121,13 +123,58 @@ namespace GFGGame
|
|
|
{
|
|
|
_chapterID = (int)(this.viewData as object[])[0];
|
|
|
currentDifficulty = (int)(this.viewData as object[])[1];
|
|
|
+
|
|
|
+ if (!backRefresh && MainStoryDataManager.currentChapterCfgId != _chapterID)
|
|
|
+ {
|
|
|
+ _chapterID = MainStoryDataManager.currentChapterCfgId;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MainStoryDataManager.currentChapterCfgId = _chapterID;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
_chapterID = (int)this.viewData;
|
|
|
}
|
|
|
- MainStoryDataManager.currentChapterCfgId = _chapterID;
|
|
|
|
|
|
+ _valueBarController.OnShown();
|
|
|
+ _ui.m_t0.SetHook("canHit", () => { _ui.target.touchable = true; });
|
|
|
+ _ui.m_t0.Play();
|
|
|
+ Timers.inst.AddUpdate(CheckGuide);
|
|
|
+
|
|
|
+ UpdateView();
|
|
|
+
|
|
|
+
|
|
|
+ //
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void OnHide()
|
|
|
+ {
|
|
|
+ base.OnHide();
|
|
|
+ _unPasslevelItem = null;
|
|
|
+ _endLevelItem = null;
|
|
|
+ // _ui.m_chapter.RemoveChildren(0, 0, true);
|
|
|
+ GRoot.inst.touchable = true;
|
|
|
+ _valueBarController.OnHide();
|
|
|
+ Timers.inst.Remove(SetContainerY);
|
|
|
+ Timers.inst.Remove(CheckGuide);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void RemoveEventListener()
|
|
|
+ {
|
|
|
+ base.RemoveEventListener();
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
|
|
|
+ }
|
|
|
+ private void OnClickBtnBack()
|
|
|
+ {
|
|
|
+ ViewManager.GoBackFrom(typeof(StoryChapterView).FullName);
|
|
|
+ //GameController.GoBackToMainView();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void UpdateView()
|
|
|
+ {
|
|
|
//由于这里会切换特效,所以切换界面时进行清空
|
|
|
EffectUIPool.Recycle(_effectUI2);
|
|
|
_effectUI2 = null;
|
|
@@ -142,14 +189,13 @@ namespace GFGGame
|
|
|
gamey = GameObject.Find("Stage/GRoot/Window - StoryChapterUI/ContentPane/CompChapter/Container/Container");
|
|
|
_ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = false;
|
|
|
_ui.m_chapter.m_compChapterScroll.m_nextEffect.visible = false;
|
|
|
+ _ui.m_targetSuit.visible = false;
|
|
|
|
|
|
Timers.inst.StartCoroutine(InitChapter());
|
|
|
|
|
|
//Timers.inst.Add(0.2f, 1, SetContainerY);
|
|
|
_ui.m_chapter.m_compChapterScroll.target.y = 1;
|
|
|
|
|
|
- _valueBarController.OnShown();
|
|
|
-
|
|
|
//招财进宝活动
|
|
|
if (chapterCfg.subType == 2)
|
|
|
{
|
|
@@ -174,42 +220,18 @@ namespace GFGGame
|
|
|
_ui.m_bonusBox.visible = true;
|
|
|
_ui.m_ActivityZCJB.visible = false;
|
|
|
}
|
|
|
- //
|
|
|
- _ui.m_t0.SetHook("canHit",()=> { _ui.target.touchable = true; });
|
|
|
- _ui.m_t0.Play();
|
|
|
-
|
|
|
-
|
|
|
- Timers.inst.AddUpdate(CheckGuide);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- protected override void OnHide()
|
|
|
- {
|
|
|
- base.OnHide();
|
|
|
- _unPasslevelItem = null;
|
|
|
- _endLevelItem = null;
|
|
|
- // _ui.m_chapter.RemoveChildren(0, 0, true);
|
|
|
- GRoot.inst.touchable = true;
|
|
|
- _valueBarController.OnHide();
|
|
|
- Timers.inst.Remove(SetContainerY);
|
|
|
- Timers.inst.Remove(CheckGuide);
|
|
|
- }
|
|
|
|
|
|
- protected override void RemoveEventListener()
|
|
|
- {
|
|
|
- base.RemoveEventListener();
|
|
|
- EventAgent.RemoveEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
|
|
|
- }
|
|
|
- private void OnClickBtnBack()
|
|
|
- {
|
|
|
- ViewManager.GoBackFrom(typeof(StoryChapterView).FullName);
|
|
|
- //GameController.GoBackToMainView();
|
|
|
- }
|
|
|
-
|
|
|
private void OnClickSwitchBack()
|
|
|
{
|
|
|
Timers.inst.Remove(SetContainerY);
|
|
|
- ViewManager.Show<StoryChapterListView>(new object[] {Mathf.Max(0, currentDifficulty) , newIndex });
|
|
|
+ ViewManager.Show<StoryChapterListView>(new object[] { Mathf.Max(0, currentDifficulty), newIndex });
|
|
|
+ }
|
|
|
+ private void OnClickGotoView()
|
|
|
+ {
|
|
|
+ StoryChapterCfg chapterSuitCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID);
|
|
|
+ ViewManager.Show<ClothingSyntheticView>(new object[] { chapterSuitCfg.suitId, 0, _chapterID }, false, false);
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnHome()
|
|
@@ -219,23 +241,27 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickNext()
|
|
|
{
|
|
|
- if (MainStoryDataManager.CheckChapterUnlock(_chapterID+1))
|
|
|
+ StoryChapterCfg chapterSuitCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID);
|
|
|
+ if (MainStoryDataManager.CheckChapterUnlock(_chapterID + 1) && StoryController.CheckSuitGot(chapterSuitCfg.suitId))
|
|
|
{
|
|
|
Timers.inst.Remove(SetContainerY);
|
|
|
- ViewManager.Show<StoryChapterView>(new object[] { _chapterID+1, currentDifficulty });
|
|
|
+ _chapterID += 1;
|
|
|
+ MainStoryDataManager.currentChapterCfgId = _chapterID;
|
|
|
+ //ViewManager.Show<StoryChapterView>(new object[] { (_chapterID+1), currentDifficulty });
|
|
|
+ UpdateView();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID + 1);
|
|
|
- if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) < chapterCfg.lvl)
|
|
|
+ if (!StoryController.CheckSuitGot(chapterSuitCfg.suitId))
|
|
|
{
|
|
|
- PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级开启",chapterCfg.lvl));
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("需集齐所需套装");
|
|
|
}
|
|
|
- else
|
|
|
+ else if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) < chapterCfg.lvl)
|
|
|
{
|
|
|
- PromptController.Instance.ShowFloatTextPrompt("需通关前置关卡");
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级开启", chapterCfg.lvl));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -268,6 +294,21 @@ namespace GFGGame
|
|
|
{
|
|
|
_ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = true;
|
|
|
_ui.m_chapter.m_compChapterScroll.m_nextEffect.visible = true;
|
|
|
+ if (chapterCfg.suitId > 0 && chapterCfg.subType == 0)
|
|
|
+ {
|
|
|
+ _ui.m_targetSuit.visible = true;
|
|
|
+ SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(chapterCfg.suitId);
|
|
|
+ _ui.m_suitIcon.url = ResPathUtil.GetIconPath(suitCfg.res, "png");
|
|
|
+ _ui.m_suitText.text = suitCfg.name;
|
|
|
+ int count;
|
|
|
+ int totalCount;
|
|
|
+ DressUpMenuSuitDataManager.GetSuitProgressBySuitId(chapterCfg.suitId, out count, out totalCount);
|
|
|
+ _ui.m_suitNum.text = count + "/" + totalCount;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _ui.m_targetSuit.visible = false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//根据困难程度选择显示图片
|
|
@@ -313,7 +354,7 @@ namespace GFGGame
|
|
|
{
|
|
|
levelItem.m_flower.target.visible = true;
|
|
|
int starCount = InstanceZonesDataManager.GetStarCountHistory(levelCfg.id);
|
|
|
- StoryUtil.UpdateStar(starCount, levelItem.m_flower.target,Mathf.Max(0, currentDifficulty));
|
|
|
+ StoryUtil.UpdateStar(starCount, levelItem.m_flower.target, Mathf.Max(0, currentDifficulty));
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -372,14 +413,14 @@ namespace GFGGame
|
|
|
string effName;
|
|
|
if (currentDifficulty == 1)
|
|
|
{
|
|
|
- effName = effArray[levelItem.m_c1.selectedIndex] + "_Bule";
|
|
|
+ effName = effArray[levelItem.m_c1.selectedIndex] + "_Bule";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
effName = effArray[levelItem.m_c1.selectedIndex];
|
|
|
}
|
|
|
- if(levelItem.m_c1.selectedIndex == 0)
|
|
|
- {
|
|
|
+ if (levelItem.m_c1.selectedIndex == 0)
|
|
|
+ {
|
|
|
if (levelItem.m_c2.selectedIndex == 0)
|
|
|
{
|
|
|
_effectUI2 = EffectUIPool.CreateEffectUI(_effFirst.GetChild("effect_jq_left").asGraph, "ui_zj", effName);
|
|
@@ -462,7 +503,7 @@ namespace GFGGame
|
|
|
}
|
|
|
private void UpdateBonusBoxStatus(UI_CompBonusBox bonusBox, int index)
|
|
|
{
|
|
|
- int status = MainStoryDataManager.GetChapterBonusStatus(MainStoryDataManager.currentChapterCfgId, index);
|
|
|
+ int status = MainStoryDataManager.GetChapterBonusStatus(_chapterID, index);
|
|
|
bonusBox.m_iconActive.visible = status == ConstBonusStatus.CAN_GET;
|
|
|
// bonusBox.m_ComRewardEffect.visible = status == ConstBonusStatus.CAN_GET;
|
|
|
if (status == ConstBonusStatus.GOT)
|
|
@@ -481,10 +522,10 @@ namespace GFGGame
|
|
|
int status = (int)bonusBox.target.data;
|
|
|
if (status == ConstBonusStatus.CAN_GET)
|
|
|
{
|
|
|
- bool got = await MainStorySProxy.GetMainStoryBoxBonus(MainStoryDataManager.currentChapterCfgId, index);
|
|
|
+ bool got = await MainStorySProxy.GetMainStoryBoxBonus(_chapterID, index);
|
|
|
if (got)
|
|
|
{
|
|
|
- List<ItemData> bonusList = MainStoryDataManager.GetChapterBonus(MainStoryDataManager.currentChapterCfgId, index);
|
|
|
+ List<ItemData> bonusList = MainStoryDataManager.GetChapterBonus(_chapterID, index);
|
|
|
if (bonusList != null && bonusList.Count > 0)
|
|
|
{
|
|
|
BonusController.TryShowBonusList(bonusList);
|
|
@@ -518,13 +559,13 @@ namespace GFGGame
|
|
|
|| GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER_5) <= 0
|
|
|
|| GuideDataManager.IsGuideFinish(ConstGuideId.UP_CARD_STAR) <= 0
|
|
|
|| GuideDataManager.IsGuideFinish(ConstGuideId.ARENA_OPEN) <= 0)
|
|
|
- //|| GuideDataManager.IsGuideFinish(ConstGuideId.CLOTHING_DECOMPOSE) <= 0)
|
|
|
+ //|| GuideDataManager.IsGuideFinish(ConstGuideId.CLOTHING_DECOMPOSE) <= 0)
|
|
|
{
|
|
|
UpdateToCheckGuide(null);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Timers.inst.Remove(CheckGuide);
|
|
|
+ Timers.inst.Remove(CheckGuide);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -539,7 +580,7 @@ namespace GFGGame
|
|
|
bool isGuide3 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.ENTER_CHAPTER_1, 3, "来继续我们的旅程吧。");
|
|
|
GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_1, 3);
|
|
|
|
|
|
- bool isGuide4 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.BUY_CLOTHING, 1, "衣服被弄脏了,到机场更衣室换身衣服吧。");
|
|
|
+ bool isGuide4 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.BUY_CLOTHING, 1, "停电了室内温度升高,点击换身轻薄的服饰吧。");
|
|
|
bool isGuide5 = GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.UP_CARD_LV, 1, "点击返回主界面。");
|
|
|
|
|
|
//bool isGuide6 = GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.CLOTHING_DECOMPOSE, 1, "点击返回主界面。");
|
|
@@ -560,7 +601,7 @@ namespace GFGGame
|
|
|
bool isGuide12 = GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.ARENA_OPEN, 1, "点击返回主界面。");
|
|
|
|
|
|
//&& !isGuide6 && !isGuide8
|
|
|
- _ui.m_chapter.target.scrollPane.touchEffect = !isGuide0 && !isGuide1 && !isGuide2 && !isGuide3 && !isGuide4 && !isGuide5 && !isGuide7 && !isGuide9 && !isGuide10;
|
|
|
+ _ui.m_chapter.target.scrollPane.touchEffect = !isGuide0 && !isGuide1 && !isGuide2 && !isGuide3 && !isGuide4 && !isGuide5 && !isGuide7 && !isGuide9 && !isGuide10;
|
|
|
|
|
|
}
|
|
|
protected override void TryCompleteGuide()
|