GuideController.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. using FairyGUI;
  2. using UI.DressUp;
  3. using UI.Main;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. using UI.ClothingSynthetic;
  7. namespace GFGGame
  8. {
  9. public class GuideController
  10. {
  11. /*******************************************************单人战斗引导***********************************************/
  12. public static void TryGuideChapterViewLevelItem(GObject target, string guideStr = null)
  13. {
  14. if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
  15. {
  16. if (guideStr == null)
  17. {
  18. UI_CompStoryLevelItem levelItem = UI_CompStoryLevelItem.Proxy(target);
  19. if (levelItem != null)
  20. {
  21. int level = int.Parse(levelItem.target.name.Replace("g", ""));
  22. string levelID = StoryDataManager.currentChapter + "_" + level;
  23. StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
  24. if (storyLevelCfg.fightID != null && storyLevelCfg.fightID.Length > 0)
  25. {
  26. guideStr = "遇到意外事件了,暂时解释不清,先按请求换上服饰吧";
  27. }
  28. else
  29. {
  30. guideStr = "点击关卡图标,继续故事";
  31. }
  32. }
  33. else
  34. {
  35. guideStr = "点击,继续";
  36. }
  37. }
  38. GuideDataManager.currentGuideId = ConstGuideId.SINGLE_FIGHT_GUIDE;
  39. ShowGuide(target, true, guideStr);
  40. }
  41. }
  42. public static void TryGuideChapterInfoViewBtnStart(GObject target, string guideStr = null)
  43. {
  44. if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
  45. {
  46. if (guideStr == null)
  47. {
  48. guideStr = "点击,继续";
  49. }
  50. ShowGuide(target, true, guideStr);
  51. }
  52. }
  53. public static bool TryGuideDressUpFightViewMenuType0(GList list)
  54. {
  55. if (StoryDataManager.currentChapter == 1 && StoryDataManager.currentLevel <= 2
  56. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  57. {
  58. int len = list.numChildren;
  59. for (int i = 0; i < len; i++)
  60. {
  61. UI_TypeItem item = UI_TypeItem.Proxy(list.GetChildAt(i));
  62. if (item != null)
  63. {
  64. int menuID = (int)item.target.data;
  65. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  66. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.LIAN_YI_QUN)
  67. {
  68. ShowGuide(item.target, true, "点击相应的分类,可以快速找到服饰");
  69. return true;
  70. }
  71. }
  72. }
  73. }
  74. return false;
  75. }
  76. public static void TryGuideDressUpFightViewMenuPart0(GList list, string guideStr)
  77. {
  78. if (StoryDataManager.currentChapter == 1 && StoryDataManager.currentLevel <= 2
  79. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  80. {
  81. if (list.numChildren > 0)
  82. {
  83. UI_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(0));
  84. if (listItem != null)
  85. {
  86. ShowGuide(listItem.target, true, guideStr);
  87. return;
  88. }
  89. }
  90. }
  91. }
  92. public static void TryGuideDressUpFightViewBtnNext0(GObject target)
  93. {
  94. if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
  95. {
  96. ShowGuide(target, false, "接下来验证一下,换上的服饰是否符合需求");
  97. }
  98. }
  99. public static void TryGuideSingleScoreViewComClickCircle(GObject target)
  100. {
  101. ShowGuide(target, false, "服饰比较繁琐,适当的整理会更加分,点击为各部位修整吧");
  102. }
  103. /*******************************************************引导购买必需品***********************************************/
  104. public static void TryGuideDressUpFightViewBtnRecommend(GObject target, GList list)
  105. {
  106. _list = list;
  107. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  108. && StoryDataManager.currentLevel == 4
  109. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel)
  110. && DressUpMenuItemDataManager.GetRecommendCount() >= 2)
  111. {
  112. GuideDataManager.currentGuideId = ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY;
  113. ShowGuide(target, false, "当提示有“必需品”时,需要穿上对应物品才能通关");
  114. }
  115. }
  116. public static void TryGuideApproachOfItemViewList(GList list)
  117. {
  118. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  119. && StoryDataManager.currentLevel == 4
  120. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel)
  121. && DressUpMenuItemDataManager.GetRecommendCount() >= 2)
  122. {
  123. UI.CommonGame.UI_ApproachOfItemUI listItem = UI.CommonGame.UI_ApproachOfItemUI.Proxy(list.GetChildAt(0));
  124. if (listItem != null)
  125. {
  126. ShowGuide(listItem.target, false, "该物品可以在服装店购买,点开服装店看看");
  127. }
  128. }
  129. }
  130. public static void TryGuideClothingShopViewBtnBug(GObject target)
  131. {
  132. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  133. && StoryDataManager.currentLevel == 4
  134. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel)
  135. && DressUpMenuItemDataManager.GetRecommendCount() >= 2)
  136. {
  137. ShowGuide(target, false, "找到需要的物品了,点击购买吧");
  138. }
  139. }
  140. public static void TryGuideBuyCountViewBtnSure(GObject target)
  141. {
  142. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  143. && StoryDataManager.currentLevel == 4
  144. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  145. {
  146. ShowGuide(target, false, "点击购买");
  147. }
  148. }
  149. public static void TryGuideClothingShopViewBtnBack(GObject target)
  150. {
  151. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  152. && StoryDataManager.currentLevel == 4
  153. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  154. {
  155. ShowGuide(target, false, "点击返回,回到换装");
  156. }
  157. }
  158. private static GList _list;
  159. public static bool TryGuideDressUpFightViewMenuType1()
  160. {
  161. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  162. && StoryDataManager.currentLevel == 4
  163. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  164. {
  165. int len = _list.numChildren;
  166. for (int i = 0; i < len; i++)
  167. {
  168. UI_comListType item = UI_comListType.Proxy(_list.GetChildAt(i));
  169. if (item != null)
  170. {
  171. int menuID = (int)item.target.data;
  172. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  173. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.LIAN_YI_QUN)
  174. {
  175. ShowGuide(item.target, true, "在相应分类里就可以找到必需品啦");
  176. _list = null;
  177. return true;
  178. }
  179. }
  180. }
  181. }
  182. return false;
  183. }
  184. public static void TryGuideDressUpFightViewMenuPart1(GList list, string guideStr)
  185. {
  186. if (StoryDataManager.currentChapter == 1 && StoryDataManager.currentLevel == 4
  187. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  188. {
  189. if (list.numChildren > 0)
  190. {
  191. UI_PartsList listItem = UI_PartsList.Proxy(list.GetChildAt(0));
  192. if (listItem != null)
  193. {
  194. ShowGuide(listItem.target, true, guideStr);
  195. return;
  196. }
  197. }
  198. }
  199. }
  200. /***************************************************点击查看关卡提示***************************************************/
  201. public static void TryGuideDressUpFightViewBtnHint(GObject target)
  202. {
  203. if (GuideDataManager.GetGuideCount(ConstGuideId.SEE_DRESS_TIPS) <= 0
  204. && StoryDataManager.currentLevel == 6
  205. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  206. {
  207. GuideDataManager.currentGuideId = ConstGuideId.SEE_DRESS_TIPS;
  208. ShowGuide(target, false, "这次换装需要获得别人的认可呢");
  209. }
  210. }
  211. /******************************************************双人对战评分************************************************/
  212. public static void TryGuideStoryFightTargetScoreComCircle(GObject target, float devWidth, float devHeight)
  213. {
  214. if (GuideDataManager.GetGuideCount(ConstGuideId.TARGET_FIGHT_GUIDE) <= 0
  215. && StoryDataManager.currentLevel == 6
  216. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  217. {
  218. GuideDataManager.currentGuideId = ConstGuideId.TARGET_FIGHT_GUIDE;
  219. ShowGuide(target, false, "这里可以观察双方的分数计算", 0, false, devWidth, devHeight);
  220. }
  221. }
  222. public static void TryGuideStoryFightTargetScorebtnSkill0(GObject target)
  223. {
  224. if (GuideDataManager.GetGuideCount(ConstGuideId.TARGET_FIGHT_GUIDE) <= 0
  225. && StoryDataManager.currentLevel == 6
  226. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  227. {
  228. ShowGuide(target, false, "使用技能,可以增加胜出的几率哦,点击看看");
  229. }
  230. }
  231. /*******************************************************引导抽奖***********************************************/
  232. public static bool TryGuideGoBackStoryChapter(GObject target)
  233. {
  234. Debug.Log(StoryDataManager.CheckLevelPass(1, 10));
  235. if (GuideDataManager.GetGuideCount(ConstGuideId.MAIN_UI_BTN_ZHAI_XING) <= 0
  236. && StoryDataManager.CheckLevelPass(1, 10)
  237. && !StoryDataManager.CheckLevelPass(1, 11))
  238. {
  239. GuideDataManager.currentGuideId = ConstGuideId.MAIN_UI_BTN_ZHAI_XING;
  240. ShowGuide(target, true, "点击返回主界面", 0);
  241. return true;
  242. }
  243. return false;
  244. }
  245. public static bool TryGuideLuckyBox(GObject target)
  246. {
  247. if (GuideDataManager.GetGuideCount(ConstGuideId.MAIN_UI_BTN_ZHAI_XING) <= 0
  248. && StoryDataManager.CheckLevelPass(1, 10)
  249. && !StoryDataManager.CheckLevelPass(1, 11))
  250. {
  251. GuideDataManager.currentGuideId = ConstGuideId.MAIN_UI_BTN_ZHAI_XING;
  252. ShowGuide(target, false, "“摘星”里可以通过星辰的力量获得服饰");
  253. return true;
  254. }
  255. return false;
  256. }
  257. public static bool TryGuideLuckyBoxStar()
  258. {
  259. if (GuideDataManager.GetGuideCount(ConstGuideId.MAIN_UI_BTN_ZHAI_XING) <= 0
  260. && StoryDataManager.CheckLevelPass(1, 10)
  261. && !StoryDataManager.CheckLevelPass(1, 11))
  262. {
  263. GuideDataManager.currentGuideId = ConstGuideId.MAIN_UI_BTN_ZHAI_XING;
  264. ShowGuide(null, false, "点击将星星链接在一起", 1400);
  265. return true;
  266. }
  267. return false;
  268. }
  269. /*****************************************************引导自由换装保存套装*************************************************/
  270. public static bool TryGuideDressUpViewMenuType1(GList list)
  271. {
  272. if (GuideDataManager.currentGuideId == ConstGuideId.MAIN_UI_BTN_HUAN_ZHUANG)
  273. {
  274. int len = list.numChildren;
  275. list.ScrollToView(len - 1);
  276. for (int i = 0; i < len; i++)
  277. {
  278. UI_comListType item = UI_comListType.Proxy(list.GetChildAt(i));
  279. if (item != null)
  280. {
  281. int menuID = (int)item.target.data;
  282. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  283. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
  284. {
  285. ShowGuide(item.target, true, "套装分类里,可以查看集齐成套的服饰");
  286. return true;
  287. }
  288. }
  289. }
  290. }
  291. return false;
  292. }
  293. public static void TryGuideDressUpViewMenuPart(GList list)
  294. {
  295. if (GuideDataManager.currentGuideId == ConstGuideId.MAIN_UI_BTN_HUAN_ZHUANG)
  296. {
  297. if (list.numChildren > 0)
  298. {
  299. UI_PartsList listItem = UI_PartsList.Proxy(list.GetChildAt(0));
  300. if (listItem != null)
  301. {
  302. ShowGuide(listItem.target, true, "点击一键换上");
  303. return;
  304. }
  305. }
  306. }
  307. }
  308. /************************************************************引导合成套装*******************************************************/
  309. public static void TryGuideStoryLevelInfoViewTxtNeed(GObject target)
  310. {
  311. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  312. && StoryDataManager.CheckLevelPass(2, 1)
  313. && !StoryDataManager.CheckLevelPass(2, 2)
  314. && StoryDataManager.currentChapter == 2 && StoryDataManager.currentLevel <= 2)
  315. {
  316. GuideDataManager.currentGuideId = ConstGuideId.SUIT_SYNTHETIC_GUIDE;
  317. ShowGuide(target, false, "这次必需品,要通过合成获得", 0, true);
  318. }
  319. }
  320. public static void TryGuideStoryLevelInfoView(GObject target)
  321. {
  322. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  323. && StoryDataManager.CheckLevelPass(2, 1)
  324. && !StoryDataManager.CheckLevelPass(2, 2)
  325. && GuideDataManager.currentGuideId == ConstGuideId.SUIT_SYNTHETIC_GUIDE)
  326. {
  327. ShowGuide(target, false, "点击空白处关闭", 1400);
  328. }
  329. }
  330. public static void TryGuideStoryChapterViewBtnHome(GObject target)
  331. {
  332. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  333. && StoryDataManager.CheckLevelPass(2, 1)
  334. && !StoryDataManager.CheckLevelPass(2, 2))
  335. {
  336. ShowGuide(target, false, "先回到主界面", 0);
  337. }
  338. }
  339. public static bool TryGuideMainUIViewBtnXiuFang(GObject target)
  340. {
  341. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  342. && StoryDataManager.CheckLevelPass(2, 1)
  343. && !StoryDataManager.CheckLevelPass(2, 2)
  344. // && GuideDataManager.currentGuideId == ConstGuideId.SUIT_SYNTHETIC_GUIDE
  345. )
  346. {
  347. GuideDataManager.currentGuideId = ConstGuideId.SUIT_SYNTHETIC_GUIDE;
  348. ShowGuide(target, false, "绣坊里增添了新功能", 0);
  349. return true;
  350. }
  351. return false;
  352. }
  353. public static void TryGuideSuitSyntheticView(GObject target)
  354. {
  355. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  356. && StoryDataManager.CheckLevelPass(2, 1)
  357. && !StoryDataManager.CheckLevelPass(2, 2))
  358. {
  359. ShowGuide(target, false, "这里可以查看已获得的服饰图谱", 0);
  360. }
  361. }
  362. public static void TryGuideSuitSyntheticViewList(GList list)
  363. {
  364. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  365. && StoryDataManager.CheckLevelPass(2, 1)
  366. && !StoryDataManager.CheckLevelPass(2, 2))
  367. {
  368. if (list.numChildren > 0)
  369. {
  370. UI_SuitListItem listItem = UI_SuitListItem.Proxy(list.GetChildAt(0));
  371. if (listItem != null)
  372. {
  373. ShowGuide(listItem.target, true, "查看已解锁的图谱");
  374. return;
  375. }
  376. }
  377. }
  378. }
  379. public static void TryGuideClothingSyntheticViewSuitList(GList list)
  380. {
  381. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  382. && StoryDataManager.CheckLevelPass(2, 1)
  383. && !StoryDataManager.CheckLevelPass(2, 2))
  384. {
  385. if (list.numChildren > 0)
  386. {
  387. UI_MateriasListItem listItem = UI_MateriasListItem.Proxy(list.GetChildAt(0));
  388. if (listItem != null)
  389. {
  390. ShowGuide(listItem.m_loaderIcon, true, "找到需要合成的物品", 0, false);
  391. return;
  392. }
  393. }
  394. }
  395. }
  396. public static void TryGuideClothingSyntheticViewList(GList list)
  397. {
  398. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  399. && StoryDataManager.CheckLevelPass(2, 1)
  400. && !StoryDataManager.CheckLevelPass(2, 2))
  401. {
  402. if (list.numChildren > 0)
  403. {
  404. UI_MateriasListItem listItem = UI_MateriasListItem.Proxy(list.GetChildAt(0));
  405. if (listItem != null)
  406. {
  407. ShowGuide(listItem.m_loaderIcon, true, "这里可以查看合成需要的材料,和材料的获取途径", 0, false);
  408. return;
  409. }
  410. }
  411. }
  412. }
  413. public static void TryGuideClothingSyntheticViewBtnProduction(GObject target)
  414. {
  415. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  416. && StoryDataManager.CheckLevelPass(2, 1)
  417. && !StoryDataManager.CheckLevelPass(2, 2))
  418. {
  419. ShowGuide(target, true, "点击合成物品");
  420. }
  421. }
  422. public static void TryGuideClothingSyntheticViewBtnHome(GObject target)
  423. {
  424. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  425. && StoryDataManager.CheckLevelPass(2, 1)
  426. && !StoryDataManager.CheckLevelPass(2, 2))
  427. {
  428. ShowGuide(target, true, "获得必需品啦,继续通关主线剧情吧");
  429. }
  430. }
  431. /************************************************************引导使用卡牌战斗*******************************************************/
  432. public static void TryGuideStoryCardChoose(GList list)
  433. {
  434. if (GuideDataManager.GetGuideCount(ConstGuideId.USE_CARD_FIGHT) <= 0
  435. && StoryDataManager.CheckLevelPass(2, 5)
  436. && !StoryDataManager.CheckLevelPass(2, 6)
  437. && StoryDataManager.currentChapter == 2 && StoryDataManager.currentLevel == 6)
  438. {
  439. if (list.numChildren > 0)
  440. {
  441. UI_ListCardItem listItem = UI_ListCardItem.Proxy(list.GetChildAt(0));
  442. if (listItem != null)
  443. {
  444. GuideDataManager.currentGuideId = ConstGuideId.USE_CARD_FIGHT;
  445. ShowGuide(listItem.target, true, "选择一张合适的词牌,增加过关战斗力");
  446. return;
  447. }
  448. }
  449. }
  450. }
  451. public static void TryGuideStoryCardChooseBtnConfirm(GObject target)
  452. {
  453. if (GuideDataManager.GetGuideCount(ConstGuideId.USE_CARD_FIGHT) <= 0
  454. && StoryDataManager.CheckLevelPass(2, 5)
  455. && !StoryDataManager.CheckLevelPass(2, 6))
  456. {
  457. ShowGuide(target, true, "点击确定进行战斗");
  458. }
  459. }
  460. /*****************************************************************提示标签**************************************************/
  461. public static void TryGuideStoryLevelInfoListTag(GObject target)
  462. {
  463. if (GuideDataManager.GetGuideCount(ConstGuideId.TIPS_TAGS_FIGHT) <= 0
  464. && StoryDataManager.CheckLevelPass(2, 7)
  465. && !StoryDataManager.CheckLevelPass(2, 8))
  466. {
  467. GuideDataManager.currentGuideId = ConstGuideId.TIPS_TAGS_FIGHT;
  468. ShowGuide(target, true, "选择相应的关卡标签,可提高分数", 0, true);
  469. }
  470. }
  471. /***********************************************************词牌升星********************************************************/
  472. public static void TryGuideStoryLevelInfoBtnHome(GObject target)
  473. {
  474. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  475. && StoryDataManager.CheckLevelPass(2, 14)
  476. && !StoryDataManager.CheckLevelPass(2, 15))
  477. {
  478. GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
  479. ShowGuide(target, true, "已经收集了足够的材料,可以给词牌升星了", 0, true);
  480. }
  481. }
  482. public static void TryGuideMainUIViewBtnCiPai(GObject target)
  483. {
  484. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  485. && StoryDataManager.CheckLevelPass(2, 14)
  486. && !StoryDataManager.CheckLevelPass(2, 15))
  487. {
  488. GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
  489. ShowGuide(target, true, "点击词牌", 0);
  490. }
  491. }
  492. public static void TryGuideCardDetailViewList(GList list)
  493. {
  494. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  495. && StoryDataManager.CheckLevelPass(2, 14)
  496. && !StoryDataManager.CheckLevelPass(2, 15))
  497. {
  498. if (list.numChildren > 0)
  499. {
  500. UI.Card.UI_ListCardItem listItem = UI.Card.UI_ListCardItem.Proxy(list.GetChildAt(0));
  501. if (listItem != null)
  502. {
  503. GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
  504. ShowGuide(listItem.target, true, "选择可升星的词牌", 0);
  505. return;
  506. }
  507. }
  508. }
  509. }
  510. public static void TryGuideCardFosterViewBtnStar(GObject target)
  511. {
  512. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  513. && StoryDataManager.CheckLevelPass(2, 14)
  514. && !StoryDataManager.CheckLevelPass(2, 15))
  515. {
  516. ShowGuide(target, true, "升满5星后,可解锁词牌的隐藏卡面哦", 0);
  517. }
  518. }
  519. /*******************************************************************************************************************/
  520. public static bool TryGuideByGuideId(GObject target, int guideId, int maxCount = 1, bool needUpdate = false, string guideStr = null, int yTxt = 0, int preGuideIdAtThisLogin = 0)
  521. {
  522. if (preGuideIdAtThisLogin > 0 && !GuideDataManager.CheckGuideIsCompletedAtThisLogin(preGuideIdAtThisLogin))
  523. {
  524. return false;
  525. }
  526. if (GuideDataManager.GetGuideCount(guideId) < maxCount)
  527. {
  528. GuideDataManager.currentGuideId = guideId;
  529. ShowGuide(target, needUpdate, guideStr, yTxt);
  530. return true;
  531. }
  532. return false;
  533. }
  534. public static bool TryCompleteGuide(int guideId)
  535. {
  536. bool result = GuideDataManager.TryCompleteGuide(guideId);
  537. if (result)
  538. {
  539. HideGuide();
  540. }
  541. return result;
  542. }
  543. public static void HideGuide()
  544. {
  545. ViewManager.Hide(ViewName.GUIDE_VIEW);
  546. }
  547. private static void ShowGuide(GObject target, bool needUpdate = false, string guideStr = null, int yTxt = 0, bool isOptionalGuide = false, float devWidth = 0, float devHeight = 0)
  548. {
  549. HideGuide();
  550. if (GameGlobal.skipGuide)
  551. {
  552. return;
  553. }
  554. ViewManager.Show(ViewName.GUIDE_VIEW, new List<object> { target, needUpdate, guideStr, yTxt, isOptionalGuide, devWidth, devHeight
  555. });
  556. }
  557. }
  558. }