GuideController.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  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 TryGuideClothingSyntheticViewList(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 TryGuideClothingSyntheticViewBtnProduction(GObject target)
  397. {
  398. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  399. && StoryDataManager.CheckLevelPass(2, 1)
  400. && !StoryDataManager.CheckLevelPass(2, 2))
  401. {
  402. ShowGuide(target, true, "点击进行制作");
  403. }
  404. }
  405. /************************************************************引导使用卡牌战斗*******************************************************/
  406. public static void TryGuideStoryCardChoose(GList list)
  407. {
  408. if (GuideDataManager.GetGuideCount(ConstGuideId.USE_CARD_FIGHT) <= 0
  409. && StoryDataManager.CheckLevelPass(2, 5)
  410. && !StoryDataManager.CheckLevelPass(2, 6)
  411. && StoryDataManager.currentChapter == 2 && StoryDataManager.currentLevel == 6)
  412. {
  413. if (list.numChildren > 0)
  414. {
  415. UI_ListCardItem listItem = UI_ListCardItem.Proxy(list.GetChildAt(0));
  416. if (listItem != null)
  417. {
  418. GuideDataManager.currentGuideId = ConstGuideId.USE_CARD_FIGHT;
  419. ShowGuide(listItem.target, true, "选择一张卡牌进行战斗");
  420. return;
  421. }
  422. }
  423. }
  424. }
  425. public static void TryGuideStoryCardChooseBtnConfirm(GObject target)
  426. {
  427. if (GuideDataManager.GetGuideCount(ConstGuideId.USE_CARD_FIGHT) <= 0
  428. && StoryDataManager.CheckLevelPass(2, 5)
  429. && !StoryDataManager.CheckLevelPass(2, 6))
  430. {
  431. ShowGuide(target, true, "点击确定进行战斗");
  432. }
  433. }
  434. /*****************************************************************提示标签**************************************************/
  435. public static void TryGuideStoryLevelInfoListTag(GObject target)
  436. {
  437. if (GuideDataManager.GetGuideCount(ConstGuideId.TIPS_TAGS_FIGHT) <= 0
  438. && StoryDataManager.CheckLevelPass(2, 7)
  439. && !StoryDataManager.CheckLevelPass(2, 8))
  440. {
  441. GuideDataManager.currentGuideId = ConstGuideId.TIPS_TAGS_FIGHT;
  442. ShowGuide(target, true, "穿戴符合提示的标签,在战斗中可以获取更多分数", 0, true);
  443. }
  444. }
  445. /***********************************************************词牌升星********************************************************/
  446. public static void TryGuideStoryLevelInfoBtnHome(GObject target)
  447. {
  448. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  449. && StoryDataManager.CheckLevelPass(2, 14)
  450. && !StoryDataManager.CheckLevelPass(2, 15))
  451. {
  452. GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
  453. ShowGuide(target, true, "已经攒够升星材料了,快去词牌升星看看吧", 0, true);
  454. }
  455. }
  456. public static void TryGuideMainUIViewBtnCiPai(GObject target)
  457. {
  458. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  459. && StoryDataManager.CheckLevelPass(2, 14)
  460. && !StoryDataManager.CheckLevelPass(2, 15))
  461. // && GuideDataManager.currentGuideId == ConstGuideId.CARD_UP_STAR)
  462. {
  463. GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
  464. ShowGuide(target, true, "点击词牌", 0);
  465. }
  466. }
  467. public static void TryGuideCardViewBtnDetail(GObject target)
  468. {
  469. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  470. && StoryDataManager.CheckLevelPass(2, 14)
  471. && !StoryDataManager.CheckLevelPass(2, 15))
  472. {
  473. ShowGuide(target, true, "点击词牌列表", 0, false, -236, -181);
  474. }
  475. }
  476. public static void TryGuideCardDetailViewList(GList list)
  477. {
  478. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  479. && StoryDataManager.CheckLevelPass(2, 14)
  480. && !StoryDataManager.CheckLevelPass(2, 15))
  481. {
  482. if (list.numChildren > 0)
  483. {
  484. UI.Card.UI_ListCardItem listItem = UI.Card.UI_ListCardItem.Proxy(list.GetChildAt(0));
  485. if (listItem != null)
  486. {
  487. GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
  488. ShowGuide(listItem.target, true, "选择要升星的卡牌", 0);
  489. return;
  490. }
  491. }
  492. }
  493. }
  494. public static void TryGuideCardFosterViewBtnStar(GObject target)
  495. {
  496. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  497. && StoryDataManager.CheckLevelPass(2, 14)
  498. && !StoryDataManager.CheckLevelPass(2, 15))
  499. {
  500. ShowGuide(target, true, "点击升星", 0);
  501. }
  502. }
  503. /*******************************************************************************************************************/
  504. public static bool TryGuideByGuideId(GObject target, int guideId, int maxCount = 1, bool needUpdate = false, string guideStr = null, int yTxt = 0, int preGuideIdAtThisLogin = 0)
  505. {
  506. if (preGuideIdAtThisLogin > 0 && !GuideDataManager.CheckGuideIsCompletedAtThisLogin(preGuideIdAtThisLogin))
  507. {
  508. return false;
  509. }
  510. if (GuideDataManager.GetGuideCount(guideId) < maxCount)
  511. {
  512. GuideDataManager.currentGuideId = guideId;
  513. ShowGuide(target, needUpdate, guideStr, yTxt);
  514. return true;
  515. }
  516. return false;
  517. }
  518. public static bool TryCompleteGuide(int guideId)
  519. {
  520. bool result = GuideDataManager.TryCompleteGuide(guideId);
  521. if (result)
  522. {
  523. HideGuide();
  524. }
  525. return result;
  526. }
  527. public static void HideGuide()
  528. {
  529. ViewManager.Hide(ViewName.GUIDE_VIEW);
  530. }
  531. private static void ShowGuide(GObject target, bool needUpdate = false, string guideStr = null, int yTxt = 0, bool isOptionalGuide = false, float devWidth = 0, float devHeight = 0)
  532. {
  533. HideGuide();
  534. if (GameGlobal.skipGuide)
  535. {
  536. return;
  537. }
  538. ViewManager.Show(ViewName.GUIDE_VIEW, new List<object> { target, needUpdate, guideStr, yTxt, isOptionalGuide, devWidth, devHeight
  539. });
  540. }
  541. }
  542. }