StoryChapterView.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. using FairyGUI;
  2. using UI.CommonGame;
  3. using UI.Main;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. using System.Collections;
  7. using ET;
  8. namespace GFGGame
  9. {
  10. public class StoryChapterView : BaseWindow
  11. {
  12. private UI_StoryChapterUI _ui;
  13. private int _chapterID;
  14. private GComponent _compChapter;
  15. private ValueBarController _valueBarController;
  16. private GObject _unPasslevelItem;
  17. private GObject _endLevelItem;
  18. private EffectUI _effectUI1;
  19. private EffectUI _effectUI2;
  20. private GComponent _comEff;
  21. private GComponent _effFirst;
  22. //当前章节索引
  23. private int newIndex;
  24. //y轴移动索引
  25. private float indexY;
  26. private GameObject gamey;
  27. //特效类型数组,这里后面可以二维数组,放向左和向右的
  28. private string[] effArray = new string[2]{ "ZJ_JuQing","ZJ_ZD" };
  29. private int currentDifficulty;
  30. public override void Dispose()
  31. {
  32. EffectUIPool.Recycle(_effectUI1);
  33. _effectUI1 = null;
  34. EffectUIPool.Recycle(_effectUI2);
  35. _effectUI2 = null;
  36. if (_comEff != null)
  37. {
  38. _comEff.RemoveFromParent();
  39. _comEff.Dispose();
  40. }
  41. if (_effFirst != null)
  42. {
  43. _effFirst.RemoveFromParent();
  44. _effFirst.Dispose();
  45. }
  46. if (_valueBarController != null)
  47. {
  48. _valueBarController.Dispose();
  49. _valueBarController = null;
  50. }
  51. if (_ui != null)
  52. {
  53. _ui.Dispose();
  54. _ui = null;
  55. }
  56. base.Dispose();
  57. }
  58. protected override void Init()
  59. {
  60. base.Init();
  61. _ui = UI_StoryChapterUI.Create();
  62. viewCom = _ui.target;
  63. isfullScreen = true;
  64. //isReturnView = false;
  65. }
  66. protected override void OnInit()
  67. {
  68. base.OnInit();
  69. _valueBarController = new ValueBarController(_ui.m_valueBar);
  70. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  71. _ui.m_btnHome.onClick.Add(OnClickBtnHome);
  72. _ui.m_switchChapter.onClick.Add(OnClickSwitchBack);
  73. _ui.m_chapter.m_compChapterScroll.m_imgBegin.onClick.Add(OnClickNext);
  74. _ui.m_bonusBox1.target.onClick.Add(() =>
  75. {
  76. OnClickBonusBox(_ui.m_bonusBox1, 0);
  77. });
  78. _ui.m_bonusBox2.target.onClick.Add(() =>
  79. {
  80. OnClickBonusBox(_ui.m_bonusBox2, 1);
  81. });
  82. _ui.m_bonusBox3.target.onClick.Add(() =>
  83. {
  84. OnClickBonusBox(_ui.m_bonusBox3, 2);
  85. });
  86. _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zxian_bg3");
  87. //_comEff = new GComponent();
  88. //_comEff = UIPackage.CreateObject(UI_MainUI.PACKAGE_NAME, "ComEff").asCom;
  89. //_effectUI1 = EffectUIPool.CreateEffectUI(_comEff.GetChild("holder").asGraph, "ui_gk", "ui_gk_sg");
  90. _effFirst = new GComponent();
  91. _effFirst = UIPackage.CreateObject(UI_MainUI.PACKAGE_NAME, "ComEff").asCom;
  92. }
  93. protected override void AddEventListener()
  94. {
  95. EventAgent.AddEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
  96. }
  97. protected override void OnShown()
  98. {
  99. base.OnShown();
  100. _ui.target.touchable = false;
  101. MusicManager.Instance.PlayCroutine(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
  102. if ((this.viewData as object[]) != null)
  103. {
  104. _chapterID = (int)(this.viewData as object[])[0];
  105. currentDifficulty = (int)(this.viewData as object[])[1];
  106. }
  107. else
  108. {
  109. _chapterID = (int)this.viewData;
  110. }
  111. MainStoryDataManager.currentChapterCfgId = _chapterID;
  112. //由于这里会切换特效,所以切换界面时进行清空
  113. EffectUIPool.Recycle(_effectUI2);
  114. _effectUI2 = null;
  115. if (_effFirst != null)
  116. {
  117. _effFirst.RemoveFromParent();
  118. }
  119. StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID);
  120. newIndex = StoryUtil.GetChapterOrder(chapterCfg.id);
  121. indexY = 111.0f * Mathf.Max(0, (float)StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(chapterCfg.type, chapterCfg.subType, chapterCfg.id).Count - 5);
  122. gamey = GameObject.Find("Stage/GRoot/Window - StoryChapterUI/ContentPane/CompChapter/Container/Container");
  123. _ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = false;
  124. Timers.inst.StartCoroutine(InitChapter());
  125. Timers.inst.Add(0.5f, 1, SetContainerY);
  126. _valueBarController.OnShown();
  127. _ui.target.touchable = true;
  128. Timers.inst.AddUpdate(CheckGuide);
  129. //根据困难程度选择显示图片
  130. if (currentDifficulty == 1)
  131. {
  132. _ui.m_loaBg.url = ResPathUtil.GetSceneBgPath("zhangjie_bg", "png");
  133. }
  134. else
  135. {
  136. _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zxian_bg3");
  137. }
  138. }
  139. protected override void OnHide()
  140. {
  141. base.OnHide();
  142. _unPasslevelItem = null;
  143. _endLevelItem = null;
  144. // _ui.m_chapter.RemoveChildren(0, 0, true);
  145. _valueBarController.OnHide();
  146. Timers.inst.Remove(SetContainerY);
  147. Timers.inst.Remove(CheckGuide);
  148. }
  149. protected override void RemoveEventListener()
  150. {
  151. base.RemoveEventListener();
  152. EventAgent.RemoveEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
  153. }
  154. private void OnClickBtnBack()
  155. {
  156. ViewManager.GoBackFrom(typeof(StoryChapterView).FullName);
  157. //GameController.GoBackToMainView();
  158. }
  159. private void OnClickSwitchBack()
  160. {
  161. Timers.inst.Remove(SetContainerY);
  162. ViewManager.Show<StoryChapterListView>(new object[] { currentDifficulty , newIndex }, new object[] { typeof(StoryChapterView).FullName, this.viewData });
  163. }
  164. private void OnClickBtnHome()
  165. {
  166. GameController.GoBackToMainView();
  167. }
  168. private void OnClickNext()
  169. {
  170. if (MainStoryDataManager.CheckChapterUnlock(_chapterID+1))
  171. {
  172. Timers.inst.Remove(SetContainerY);
  173. ViewManager.Show<StoryChapterView>(new object[] { _chapterID+1, currentDifficulty });
  174. }
  175. else
  176. {
  177. StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID + 1);
  178. if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) < chapterCfg.lvl)
  179. {
  180. PromptController.Instance.ShowFloatTextPrompt(string.Format("角色等级达到{0}级开启",chapterCfg.lvl));
  181. }
  182. else
  183. {
  184. PromptController.Instance.ShowFloatTextPrompt("需通关前置关卡");
  185. }
  186. }
  187. }
  188. private IEnumerator InitChapter()
  189. {
  190. StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID);
  191. _ui.m_txtChapterName0.text = chapterCfg.name.Length > 0 ? chapterCfg.name[0].ToString() : "";
  192. _ui.m_txtChapterName1.text = chapterCfg.name.Length > 1 ? chapterCfg.name[1].ToString() : "";
  193. _ui.m_txtChapterName2.text = chapterCfg.name.Length > 2 ? chapterCfg.name[2].ToString() : "";
  194. _ui.m_txtChapterName3.text = chapterCfg.name.Length > 3 ? chapterCfg.name[3].ToString() : "";
  195. _ui.m_txtChapterName4.text = chapterCfg.name.Length > 4 ? chapterCfg.name[4].ToString() : "";
  196. int order = StoryUtil.GetChapterOrder(chapterCfg.id);
  197. _ui.m_txtChapter.text = order < 10 ? "0" + order : order.ToString();
  198. int starCountChapter = InstanceZonesDataManager.GetChapterStarCount(_chapterID, chapterCfg.type, chapterCfg.subType);
  199. _ui.m_txtStarCount.text = "" + starCountChapter + "/" + chapterCfg.bonusStar3;
  200. UpdateBonusBoxName(_ui.m_bonusBox1, "" + chapterCfg.bonusStar1);
  201. UpdateBonusBoxName(_ui.m_bonusBox2, "" + chapterCfg.bonusStar2);
  202. UpdateBonusBoxName(_ui.m_bonusBox3, "" + chapterCfg.bonusStar3);
  203. UpdateBonusBox();
  204. var list = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(chapterCfg.type, chapterCfg.subType, chapterCfg.id);
  205. int endLevel = 0;
  206. int UnlockCount = 0;
  207. _compChapter = _ui.m_chapter.m_compChapterScroll.target;
  208. float starPosY = _ui.m_chapter.m_compChapterScroll.m_imgBegin.y;
  209. int lineGap = 4500 / list.Count;
  210. StoryLevelCfg lastLevelCfg = list[list.Count - 1];
  211. if (lastLevelCfg != null && MainStoryDataManager.CheckLevelUnlock(lastLevelCfg.id))
  212. {
  213. _ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = true;
  214. }
  215. //_comEff.visible = false;
  216. //_effFirst.visible = false;
  217. for (int i = 0; i < 20; i++)
  218. {
  219. GObject obj = _ui.m_chapter.m_compChapterScroll.target.GetChild("g" + (19 - i + 1));
  220. obj.SetPosition(obj.x, starPosY - lineGap * i - 300, 0); ;
  221. StoryLevelCfg levelCfg = i < list.Count ? list[i] : null;
  222. UI_CompStoryLevelItem levelItem = UI_CompStoryLevelItem.Proxy(obj);
  223. levelItem.m_fightBg.visible = true;
  224. levelItem.m_loaDialogBg.visible = true;
  225. if (levelCfg != null && MainStoryDataManager.CheckLevelUnlock(levelCfg.id))
  226. {
  227. UnlockCount++;
  228. levelItem.target.data = levelCfg.id;
  229. levelItem.target.visible = true;
  230. levelItem.target.onClick.Clear();
  231. levelItem.target.onClick.Add(OnClickLevelItem);
  232. string showId = StoryUtil.GetChapterOrder(_chapterID) + "-" + levelCfg.order;
  233. levelItem.m_txtDialogOrder.text = showId;
  234. levelItem.m_txtFightOrder.text = showId;
  235. if (levelCfg.fightID.Length > 0)
  236. {
  237. levelItem.m_c1.selectedIndex = 1;
  238. int score = InstanceZonesDataManager.GetScoreHighest(levelCfg.id);
  239. if (score <= 0)
  240. {
  241. levelItem.m_flower.target.visible = false;
  242. }
  243. else
  244. {
  245. levelItem.m_flower.target.visible = true;
  246. int starCount = InstanceZonesDataManager.GetStarCountHistory(levelCfg.id);
  247. StoryUtil.UpdateStar(starCount, levelItem.m_flower.target);
  248. }
  249. }
  250. else
  251. {
  252. levelItem.m_c1.selectedIndex = 0;
  253. levelItem.m_flower.target.visible = false;
  254. levelItem.m_txtName.text = levelCfg.name;
  255. levelItem.m_comDialogBg.m_loabg.url = ResPathUtil.GetBgImgPath(chapterCfg.bgRes);
  256. levelItem.m_comDialogBg.m_loaIcon.url = ResPathUtil.GetChapterGuideIconPath(chapterCfg.bgRes);
  257. levelItem.m_comDialogBg.m_c1.selectedIndex = Random.Range(0, 10);
  258. }
  259. //根据困难程度选择显示图片
  260. if (currentDifficulty == 1)
  261. {
  262. levelItem.m_loaDialogBg.url = "ui://Main/zxian_btn_jq_jy";
  263. levelItem.m_fightBg.url = "ui://Main/zxian_btn_zd_jy";
  264. levelItem.m_txtFightOrder.text = string.Format("{0}", StringUtil.GetColorText(showId.ToString(), "#E3F8FF"));
  265. levelItem.m_fightIconA.alpha = 0;
  266. levelItem.m_fightIconB.alpha = 0;
  267. _ui.m_txtBg.url = "ui://Main/zxian_chapter_dec_jy";
  268. _ui.m_txtChapterName0.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
  269. _ui.m_txtChapterName1.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
  270. _ui.m_txtChapterName2.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
  271. _ui.m_txtChapterName3.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
  272. _ui.m_txtChapterName4.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
  273. _ui.m_txtChapter.strokeColor = new Color(0.592f, 0.773f, 0.961f, 1.000f);
  274. }
  275. else
  276. {
  277. levelItem.m_loaDialogBg.url = "ui://Main/zxian_btn_jq";
  278. levelItem.m_fightBg.url = "ui://Main/zxian_btn_zd";
  279. levelItem.m_txtFightOrder.text = string.Format("{0}", StringUtil.GetColorText(showId.ToString(), "#FFEABF"));
  280. levelItem.m_fightIconA.alpha = 0;
  281. levelItem.m_fightIconB.alpha = 0;
  282. _ui.m_txtBg.url = "ui://Main/zxian_chapter_dec";
  283. _ui.m_txtChapterName0.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
  284. _ui.m_txtChapterName1.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
  285. _ui.m_txtChapterName2.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
  286. _ui.m_txtChapterName3.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
  287. _ui.m_txtChapterName4.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
  288. _ui.m_txtChapter.strokeColor = new Color(1.000f, 0.686f, 0.318f, 1.000f);
  289. }
  290. levelItem.m_holder.visible = !InstanceZonesDataManager.CheckLevelPass(levelCfg.id);
  291. if (!InstanceZonesDataManager.CheckLevelPass(levelCfg.id))
  292. {
  293. //设置为解锁关卡
  294. MainStoryDataManager.currentLevelCfgId = levelCfg.id;
  295. _unPasslevelItem = levelItem.target;
  296. //levelItem.target.AddChild(_comEff);
  297. //_comEff.visible = true;
  298. //设置解锁特效
  299. string effName;
  300. if (currentDifficulty == 0)
  301. {
  302. effName = effArray[levelItem.m_c1.selectedIndex];
  303. }
  304. else
  305. {
  306. effName = effArray[levelItem.m_c1.selectedIndex] + "_Bule";
  307. }
  308. if(levelItem.m_c1.selectedIndex == 0)
  309. {
  310. if (levelItem.m_c2.selectedIndex == 0)
  311. {
  312. _effectUI2 = EffectUIPool.CreateEffectUI(_effFirst.GetChild("effect_jq_left").asGraph, "ui_zj", effName);
  313. _effFirst.GetChild("effect_jq_left").rotationY = 180;
  314. }
  315. else
  316. {
  317. _effectUI2 = EffectUIPool.CreateEffectUI(_effFirst.GetChild("effect_jq").asGraph, "ui_zj", effName);
  318. _effFirst.GetChild("effect_jq").rotationY = 0;
  319. }
  320. }
  321. else
  322. {
  323. _effectUI2 = EffectUIPool.CreateEffectUI(_effFirst.GetChild("effect_zd").asGraph, "ui_zj", effName);
  324. if (levelItem.m_c2.selectedIndex == 0)
  325. {
  326. _effFirst.GetChild("effect_zd").rotationY = 0;
  327. }
  328. else
  329. {
  330. _effFirst.GetChild("effect_zd").rotationY = 180;
  331. }
  332. }
  333. levelItem.target.AddChild(_effFirst);
  334. levelItem.m_fightBg.visible = false;
  335. levelItem.m_loaDialogBg.visible = false;
  336. _effFirst.visible = true;
  337. //Timers.inst.Add(1.7f, 1, HideEffect, obj);
  338. }
  339. if (levelCfg.order > endLevel)
  340. {
  341. endLevel = levelCfg.order;
  342. _endLevelItem = levelItem.target;
  343. }
  344. }
  345. else
  346. {
  347. levelItem.target.visible = false;
  348. }
  349. UI_CompStoryLevelItem.ProxyEnd();
  350. }
  351. yield return new WaitForEndOfFrame();
  352. _ui.m_chapter.m_compChapterScroll.target.y = 0; //Mathf.Max(0, _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height);
  353. if (gamey != null)
  354. gamey.transform.position = new Vector3(0, indexY, 0);
  355. }
  356. private void SetContainerY(object param = null)
  357. {
  358. _ui.m_chapter.m_compChapterScroll.target.y = 1; //Mathf.Max(0, _ui.m_chapter.target.height - _ui.m_chapter.m_compChapterScroll.target.height - 1);
  359. }
  360. private void HideEffect(object param = null)
  361. {
  362. //_effFirst.visible = false;
  363. }
  364. private void OnClickLevelItem(EventContext context)
  365. {
  366. UI_CompStoryLevelItem levelItem = UI_CompStoryLevelItem.Proxy(context.sender as GObject);
  367. int levelCfgId = (int)levelItem.target.data;
  368. UI_CompStoryLevelItem.ProxyEnd();
  369. StoryController.ShowLevelView(levelCfgId);
  370. TryCompleteGuide();
  371. }
  372. private void UpdateBonusBoxName(UI_CompBonusBox bonusBox, string name)
  373. {
  374. bonusBox.m_txtName.text = name;
  375. }
  376. private void UpdateBonusBox()
  377. {
  378. UpdateBonusBoxStatus(_ui.m_bonusBox1, 0);
  379. UpdateBonusBoxStatus(_ui.m_bonusBox2, 1);
  380. UpdateBonusBoxStatus(_ui.m_bonusBox3, 2);
  381. }
  382. private void UpdateBonusBoxStatus(UI_CompBonusBox bonusBox, int index)
  383. {
  384. int status = MainStoryDataManager.GetChapterBonusStatus(MainStoryDataManager.currentChapterCfgId, index);
  385. bonusBox.m_iconActive.visible = status == ConstBonusStatus.CAN_GET;
  386. // bonusBox.m_ComRewardEffect.visible = status == ConstBonusStatus.CAN_GET;
  387. if (status == ConstBonusStatus.GOT)
  388. {
  389. bonusBox.m_icon.url = "ui://Main/zxian_gift_get";
  390. }
  391. else
  392. {
  393. bonusBox.m_icon.url = "ui://Main/zxian_gift_unget";
  394. }
  395. bonusBox.target.data = status;
  396. }
  397. private async void OnClickBonusBox(UI_CompBonusBox bonusBox, int index)
  398. {
  399. int status = (int)bonusBox.target.data;
  400. if (status == ConstBonusStatus.CAN_GET)
  401. {
  402. bool got = await MainStorySProxy.GetMainStoryBoxBonus(MainStoryDataManager.currentChapterCfgId, index);
  403. if (got)
  404. {
  405. List<ItemData> bonusList = MainStoryDataManager.GetChapterBonus(MainStoryDataManager.currentChapterCfgId, index);
  406. if (bonusList != null && bonusList.Count > 0)
  407. {
  408. BonusController.TryShowBonusList(bonusList);
  409. }
  410. UpdateBonusBoxStatus(bonusBox, index);
  411. }
  412. }
  413. // else if (status == ConstBonusStatus.GOT)
  414. // {
  415. // PromptController.Instance.ShowFloatTextPrompt("这个宝箱已经被领取过了");
  416. // }
  417. else
  418. {
  419. List<ItemData> rewards = StoryBonusDataCache.GetChapterBonusList(_chapterID, index);
  420. int star = StoryBonusDataCache.GetChapterBonusStar(_chapterID, index);
  421. ViewManager.Show<RewardPreView>(new object[] { rewards, "宝箱奖励", string.Format("本章达成{0}星可领取", star) });
  422. // PromptController.Instance.ShowFloatTextPrompt("关卡总分不足,继续加油吧。");
  423. }
  424. }
  425. private void CheckGuide(object param)
  426. {
  427. if (GuideDataManager.IsGuideFinish(ConstGuideId.START_FIGHT) <= 0
  428. || GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0
  429. || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER) <= 0
  430. || GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0
  431. || GuideDataManager.IsGuideFinish(ConstGuideId.UP_CARD_LV) <= 0
  432. || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER_1) <= 0
  433. || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER_2) <= 0
  434. //|| GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER_3) <= 0
  435. || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER_4) <= 0
  436. || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER_5) <= 0
  437. || GuideDataManager.IsGuideFinish(ConstGuideId.UP_CARD_STAR) <= 0
  438. || GuideDataManager.IsGuideFinish(ConstGuideId.ARENA_OPEN) <= 0)
  439. //|| GuideDataManager.IsGuideFinish(ConstGuideId.CLOTHING_DECOMPOSE) <= 0)
  440. {
  441. UpdateToCheckGuide(null);
  442. }
  443. else
  444. {
  445. Timers.inst.Remove(CheckGuide);
  446. }
  447. }
  448. protected override void UpdateToCheckGuide(object param)
  449. {
  450. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  451. GComponent unPasslevelCom = _unPasslevelItem == null ? null : _unPasslevelItem.asCom;
  452. bool isGuide0 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.START_FIGHT, 1, "尝试换上一套衣服吧。");
  453. bool isGuide1 = GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.FREEDOM_DRESS, 1, "获得的服饰随时可以查看和试穿。");
  454. bool isGuide2 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.ENTER_CHAPTER, 5, "来继续我们的旅程吧。");
  455. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER, 5);
  456. bool isGuide3 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.ENTER_CHAPTER_1, 4, "来继续我们的旅程吧。");
  457. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_1, 4);
  458. bool isGuide4 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.BUY_CLOTHING, 1, "衣服被弄脏了,到机场更衣室换身衣服吧。");
  459. bool isGuide5 = GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.UP_CARD_LV, 1, "点击返回主界面。");
  460. //bool isGuide6 = GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.CLOTHING_DECOMPOSE, 1, "点击返回主界面。");
  461. bool isGuide7 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.ENTER_CHAPTER_2, 4, "来继续我们的旅程吧。");
  462. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_2, 4);
  463. //bool isGuide8 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.ENTER_CHAPTER_3, 3, "来继续我们的旅程吧。");
  464. //GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_3, 3);
  465. bool isGuide10 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.ENTER_CHAPTER_4, 4, "来继续我们的旅程吧。");
  466. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_4, 4);
  467. bool isGuide11 = GuideController.TryGuide(unPasslevelCom, ConstGuideId.ENTER_CHAPTER_5, 3, "来继续我们的旅程吧。");
  468. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_5, 3);
  469. bool isGuide9 = GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.UP_CARD_STAR, 1, "点击返回主界面。");
  470. bool isGuide12 = GuideController.TryGuide(_ui.m_btnHome, ConstGuideId.ARENA_OPEN, 1, "点击返回主界面。");
  471. //&& !isGuide6 && !isGuide8
  472. _ui.m_chapter.target.scrollPane.touchEffect = !isGuide0 && !isGuide1 && !isGuide2 && !isGuide3 && !isGuide4 && !isGuide5 && !isGuide7 && !isGuide9 && !isGuide10;
  473. }
  474. protected override void TryCompleteGuide()
  475. {
  476. base.TryCompleteGuide();
  477. // GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.ENTER_CHAPTER);
  478. GuideController.TryCompleteGuideIndex(ConstGuideId.ENTER_CHAPTER, 5);
  479. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER, 5);
  480. // GuideCfg cfg1 = GuideCfgArray.Instance.GetCfg(ConstGuideId.ENTER_CHAPTER_1);
  481. GuideController.TryCompleteGuideIndex(ConstGuideId.ENTER_CHAPTER_1, 4);
  482. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_1, 4);
  483. // GuideCfg cfg2 = GuideCfgArray.Instance.GetCfg(ConstGuideId.ENTER_CHAPTER_2);
  484. GuideController.TryCompleteGuideIndex(ConstGuideId.ENTER_CHAPTER_2, 4);
  485. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_2, 4);
  486. // GuideCfg cfg3 = GuideCfgArray.Instance.GetCfg(ConstGuideId.ENTER_CHAPTER_3);
  487. //GuideController.TryCompleteGuideIndex(ConstGuideId.ENTER_CHAPTER_3, 3);
  488. //GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_3, 3);
  489. // GuideCfg cfg4 = GuideCfgArray.Instance.GetCfg(ConstGuideId.ENTER_CHAPTER_4);
  490. GuideController.TryCompleteGuideIndex(ConstGuideId.ENTER_CHAPTER_4, 4);
  491. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_4, 4);
  492. // GuideCfg cfg5 = GuideCfgArray.Instance.GetCfg(ConstGuideId.ENTER_CHAPTER_5);
  493. //GuideController.TryCompleteGuideIndex(ConstGuideId.ENTER_CHAPTER_5, 4);
  494. GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_5, 3);
  495. }
  496. }
  497. }