GuideController.cs 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832
  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. else if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
  42. {
  43. }
  44. }
  45. public static void TryGuideChapterInfoViewBtnStart(GObject target, string guideStr = null)
  46. {
  47. if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
  48. {
  49. if (guideStr == null)
  50. {
  51. guideStr = "点击,继续";
  52. }
  53. ShowGuide(target, true, guideStr);
  54. }
  55. }
  56. public static bool TryGuideDressUpFightViewMenuType0(GList list)
  57. {
  58. if (StoryDataManager.currentChapter == 1 && StoryDataManager.currentLevel <= 2
  59. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  60. {
  61. int len = list.numChildren;
  62. for (int i = 0; i < len; i++)
  63. {
  64. UI_TypeItem item = UI_TypeItem.Proxy(list.GetChildAt(i));
  65. if (item != null)
  66. {
  67. int menuID = (int)item.target.data;
  68. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  69. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.LIAN_YI_QUN)
  70. {
  71. ShowGuide(item.target, true, "点击相应的分类,可以快速找到服饰");
  72. return true;
  73. }
  74. }
  75. }
  76. }
  77. return false;
  78. }
  79. public static void TryGuideDressUpFightViewMenuPart0(GList list, string guideStr)
  80. {
  81. if (StoryDataManager.currentChapter == 1 && StoryDataManager.currentLevel <= 2
  82. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  83. {
  84. if (list.numChildren > 0)
  85. {
  86. UI_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(0));
  87. if (listItem != null)
  88. {
  89. ShowGuide(listItem.target, true, guideStr);
  90. return;
  91. }
  92. }
  93. }
  94. }
  95. public static void TryGuideDressUpFightViewBtnNext0(GObject target)
  96. {
  97. if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
  98. {
  99. ShowGuide(target, false, "接下来验证一下,换上的服饰是否符合需求");
  100. }
  101. }
  102. public static void TryGuideSingleScoreViewComClickCircle(GObject target)
  103. {
  104. ShowGuide(target, false, "服饰比较繁琐,适当的整理会更加分,点击为各部位修整吧");
  105. }
  106. /*******************************************************引导购买必需品***********************************************/
  107. public static void TryGuideDressUpFightViewBtnRecommend(GObject target, GList list)
  108. {
  109. _list = list;
  110. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  111. && StoryDataManager.currentLevel == 4
  112. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel)
  113. && DressUpMenuItemDataManager.GetRecommendCount() >= 2)
  114. {
  115. GuideDataManager.currentGuideId = ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY;
  116. ShowGuide(target, false, "当提示有“必需品”时,需要穿上对应物品才能通关");
  117. }
  118. }
  119. public static void TryGuideApproachOfItemViewList(GList list)
  120. {
  121. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  122. && StoryDataManager.currentLevel == 4
  123. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel)
  124. && DressUpMenuItemDataManager.GetRecommendCount() >= 2)
  125. {
  126. UI.CommonGame.UI_ApproachOfItemUI listItem = UI.CommonGame.UI_ApproachOfItemUI.Proxy(list.GetChildAt(0));
  127. if (listItem != null)
  128. {
  129. ShowGuide(listItem.target, false, "该物品可以在服装店购买,点开服装店看看");
  130. }
  131. }
  132. }
  133. public static void TryGuideBuyCountViewBtnSure(GObject target)
  134. {
  135. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  136. && StoryDataManager.currentLevel == 4
  137. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  138. {
  139. ShowGuide(target, false, "找到需要的物品了,点击购买吧");
  140. }
  141. }
  142. public static void TryGuideClothingShopViewBtnBack(GObject target)
  143. {
  144. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  145. && StoryDataManager.currentLevel == 4
  146. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  147. {
  148. ShowGuide(target, false, "点击返回,回到换装");
  149. }
  150. }
  151. private static GList _list;
  152. public static bool TryGuideDressUpFightViewMenuType1()
  153. {
  154. if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
  155. && StoryDataManager.currentLevel == 4
  156. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  157. {
  158. int len = _list.numChildren;
  159. for (int i = 0; i < len; i++)
  160. {
  161. UI_comListType item = UI_comListType.Proxy(_list.GetChildAt(i));
  162. if (item != null)
  163. {
  164. int menuID = (int)item.target.data;
  165. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  166. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.LIAN_YI_QUN)
  167. {
  168. ShowGuide(item.target, true, "在相应分类里就可以找到必需品啦");
  169. _list = null;
  170. return true;
  171. }
  172. }
  173. }
  174. }
  175. return false;
  176. }
  177. public static void TryGuideDressUpFightViewMenuPart1(GList list, string guideStr)
  178. {
  179. if (StoryDataManager.currentChapter == 1 && StoryDataManager.currentLevel == 4
  180. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  181. {
  182. if (list.numChildren > 0)
  183. {
  184. UI_PartsList listItem = UI_PartsList.Proxy(list.GetChildAt(0));
  185. if (listItem != null)
  186. {
  187. ShowGuide(listItem.target, true, guideStr);
  188. return;
  189. }
  190. }
  191. }
  192. }
  193. /***************************************************点击查看关卡提示***************************************************/
  194. public static void TryGuideDressUpFightViewBtnHint(GObject target)
  195. {
  196. if (GuideDataManager.GetGuideCount(ConstGuideId.SEE_DRESS_TIPS) <= 0
  197. && StoryDataManager.currentLevel == 6
  198. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  199. {
  200. GuideDataManager.currentGuideId = ConstGuideId.SEE_DRESS_TIPS;
  201. ShowGuide(target, false, "这次换装需要获得别人的认可呢");
  202. }
  203. }
  204. /******************************************************双人对战评分************************************************/
  205. public static void TryGuideStoryFightTargetScoreComCircle(GObject target, float devWidth, float devHeight)
  206. {
  207. if (GuideDataManager.GetGuideCount(ConstGuideId.TARGET_FIGHT_GUIDE) <= 0
  208. && StoryDataManager.currentLevel == 6
  209. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  210. {
  211. GuideDataManager.currentGuideId = ConstGuideId.TARGET_FIGHT_GUIDE;
  212. ShowGuide(target, false, "这里可以观察双方的分数计算", 0, false, devWidth, devHeight);
  213. }
  214. }
  215. public static void TryGuideStoryFightTargetScorebtnSkill0(GObject target)
  216. {
  217. if (GuideDataManager.GetGuideCount(ConstGuideId.TARGET_FIGHT_GUIDE) <= 0
  218. && StoryDataManager.currentLevel == 6
  219. && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
  220. {
  221. ShowGuide(target, false, "使用技能,可以增加胜出的几率哦,点击看看");
  222. }
  223. }
  224. /*******************************************************引导抽奖***********************************************/
  225. public static bool TryGuideGoBackStoryChapter(GObject target)
  226. {
  227. if (GuideDataManager.GetGuideCount(ConstGuideId.MAIN_UI_BTN_ZHAI_XING) <= 0
  228. && StoryDataManager.CheckLevelPass(1, 10)
  229. && !StoryDataManager.CheckLevelPass(1, 11))
  230. {
  231. GuideDataManager.currentGuideId = ConstGuideId.MAIN_UI_BTN_ZHAI_XING;
  232. ShowGuide(target, true, "点击返回主界面", 0);
  233. return true;
  234. }
  235. return false;
  236. }
  237. public static bool TryGuideLuckyBox(GObject target)
  238. {
  239. if (GuideDataManager.GetGuideCount(ConstGuideId.MAIN_UI_BTN_ZHAI_XING) <= 0
  240. && StoryDataManager.CheckLevelPass(1, 10)
  241. && !StoryDataManager.CheckLevelPass(1, 11))
  242. {
  243. GuideDataManager.currentGuideId = ConstGuideId.MAIN_UI_BTN_ZHAI_XING;
  244. ShowGuide(target, false, "“摘星”里可以通过星辰的力量获得服饰");
  245. return true;
  246. }
  247. return false;
  248. }
  249. public static bool TryGuideLuckyBoxStar()
  250. {
  251. if (GuideDataManager.GetGuideCount(ConstGuideId.MAIN_UI_BTN_ZHAI_XING) <= 0
  252. && StoryDataManager.CheckLevelPass(1, 10)
  253. && !StoryDataManager.CheckLevelPass(1, 11))
  254. {
  255. GuideDataManager.currentGuideId = ConstGuideId.MAIN_UI_BTN_ZHAI_XING;
  256. ShowGuide(null, false, "点击将星星链接在一起", 1400);
  257. return true;
  258. }
  259. return false;
  260. }
  261. /*****************************************************引导自由换装保存套装*************************************************/
  262. public static bool TryGuideDressUpViewMenuType1(GList list)
  263. {
  264. if (GuideDataManager.currentGuideId == ConstGuideId.MAIN_UI_BTN_HUAN_ZHUANG)
  265. {
  266. int len = list.numChildren;
  267. list.ScrollToView(len - 1);
  268. for (int i = 0; i < len; i++)
  269. {
  270. UI_comListType item = UI_comListType.Proxy(list.GetChildAt(i));
  271. if (item != null)
  272. {
  273. int menuID = (int)item.target.data;
  274. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  275. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
  276. {
  277. ShowGuide(item.target, true, "套装分类里,可以查看集齐成套的服饰");
  278. return true;
  279. }
  280. }
  281. }
  282. }
  283. return false;
  284. }
  285. public static void TryGuideDressUpViewMenuPart(GList list)
  286. {
  287. if (GuideDataManager.currentGuideId == ConstGuideId.MAIN_UI_BTN_HUAN_ZHUANG)
  288. {
  289. if (list.numChildren > 0)
  290. {
  291. UI_PartsList listItem = UI_PartsList.Proxy(list.GetChildAt(0));
  292. if (listItem != null)
  293. {
  294. ShowGuide(listItem.target, true, "点击一键换上");
  295. return;
  296. }
  297. }
  298. }
  299. }
  300. /************************************************************引导合成套装*******************************************************/
  301. public static void TryGuideStoryChapterView(GObject target)
  302. {
  303. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  304. && StoryDataManager.CheckLevelPass(2, 1)
  305. && !StoryDataManager.CheckLevelPass(2, 2)
  306. && StoryDataManager.currentChapter == 2 && StoryDataManager.currentLevel <= 2)
  307. {
  308. GuideDataManager.currentGuideId = ConstGuideId.SUIT_SYNTHETIC_GUIDE;
  309. ShowGuide(target, false, "点击进行下一关");
  310. }
  311. }
  312. public static void TryGuideStoryLevelInfoViewTxtNeed(GObject target)
  313. {
  314. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  315. && StoryDataManager.CheckLevelPass(2, 1)
  316. && !StoryDataManager.CheckLevelPass(2, 2)
  317. && StoryDataManager.currentChapter == 2 && StoryDataManager.currentLevel <= 2)
  318. {
  319. GuideDataManager.currentGuideId = ConstGuideId.SUIT_SYNTHETIC_GUIDE;
  320. ShowGuide(target, false, "这次必需品,要通过合成获得", 0, true);
  321. }
  322. }
  323. public static void TryGuideStoryLevelInfoView(GObject target)
  324. {
  325. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  326. && StoryDataManager.CheckLevelPass(2, 1)
  327. && !StoryDataManager.CheckLevelPass(2, 2)
  328. && GuideDataManager.currentGuideId == ConstGuideId.SUIT_SYNTHETIC_GUIDE)
  329. {
  330. ShowGuide(target, false, "点击空白处关闭", 1400);
  331. }
  332. }
  333. public static void TryGuideStoryChapterViewBtnHome(GObject target)
  334. {
  335. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  336. && StoryDataManager.CheckLevelPass(2, 1)
  337. && !StoryDataManager.CheckLevelPass(2, 2))
  338. {
  339. ShowGuide(target, false, "先回到主界面", 0);
  340. }
  341. }
  342. public static bool TryGuideMainUIViewBtnXiuFang(GObject target)
  343. {
  344. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  345. && StoryDataManager.CheckLevelPass(2, 1)
  346. && !StoryDataManager.CheckLevelPass(2, 2)
  347. // && GuideDataManager.currentGuideId == ConstGuideId.SUIT_SYNTHETIC_GUIDE
  348. )
  349. {
  350. GuideDataManager.currentGuideId = ConstGuideId.SUIT_SYNTHETIC_GUIDE;
  351. ShowGuide(target, false, "绣坊里增添了新功能", 0);
  352. return true;
  353. }
  354. return false;
  355. }
  356. public static void TryGuideSuitSyntheticView(GObject target)
  357. {
  358. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  359. && StoryDataManager.CheckLevelPass(2, 1)
  360. && !StoryDataManager.CheckLevelPass(2, 2))
  361. {
  362. ShowGuide(target, false, "这里可以查看已获得的服饰图谱", 0);
  363. }
  364. }
  365. public static void TryGuideSuitSyntheticViewList(GList list)
  366. {
  367. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  368. && StoryDataManager.CheckLevelPass(2, 1)
  369. && !StoryDataManager.CheckLevelPass(2, 2))
  370. {
  371. if (list.numChildren > 0)
  372. {
  373. UI_SuitListItem listItem = UI_SuitListItem.Proxy(list.GetChildAt(0));
  374. if (listItem != null)
  375. {
  376. ShowGuide(listItem.target, true, "查看已解锁的图谱");
  377. return;
  378. }
  379. }
  380. }
  381. }
  382. public static void TryGuideClothingSyntheticViewSuitList(GList list)
  383. {
  384. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  385. && StoryDataManager.CheckLevelPass(2, 1)
  386. && !StoryDataManager.CheckLevelPass(2, 2))
  387. {
  388. if (list.numChildren > 0)
  389. {
  390. UI_MateriasListItem listItem = UI_MateriasListItem.Proxy(list.GetChildAt(0));
  391. if (listItem != null)
  392. {
  393. ShowGuide(listItem.m_loaderIcon, true, "找到需要合成的物品", 0, false);
  394. return;
  395. }
  396. }
  397. }
  398. }
  399. public static void TryGuideClothingSyntheticViewList(GList list)
  400. {
  401. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  402. && StoryDataManager.CheckLevelPass(2, 1)
  403. && !StoryDataManager.CheckLevelPass(2, 2))
  404. {
  405. if (list.numChildren > 0)
  406. {
  407. UI_MateriasListItem listItem = UI_MateriasListItem.Proxy(list.GetChildAt(0));
  408. if (listItem != null)
  409. {
  410. ShowGuide(listItem.m_loaderIcon, true, "这里可以查看合成需要的材料,和材料的获取途径", 0, false);
  411. return;
  412. }
  413. }
  414. }
  415. }
  416. public static void TryGuideClothingSyntheticViewBtnProduction(GObject target)
  417. {
  418. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  419. && StoryDataManager.CheckLevelPass(2, 1)
  420. && !StoryDataManager.CheckLevelPass(2, 2))
  421. {
  422. ShowGuide(target, true, "点击合成物品");
  423. }
  424. }
  425. public static void TryGuideClothingSyntheticViewBtnHome(GObject target)
  426. {
  427. if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
  428. && StoryDataManager.CheckLevelPass(2, 1)
  429. && !StoryDataManager.CheckLevelPass(2, 2))
  430. {
  431. ShowGuide(target, true, "获得必需品啦,继续通关主线剧情吧");
  432. }
  433. }
  434. /************************************************************引导使用卡牌战斗*******************************************************/
  435. public static void TryGuideStoryCardChoose(GList list)
  436. {
  437. if (GuideDataManager.GetGuideCount(ConstGuideId.USE_CARD_FIGHT) <= 0
  438. && StoryDataManager.CheckLevelPass(2, 5)
  439. && !StoryDataManager.CheckLevelPass(2, 6)
  440. && StoryDataManager.currentChapter == 2 && StoryDataManager.currentLevel == 6)
  441. {
  442. if (list.numChildren > 0)
  443. {
  444. UI_ListCardItem listItem = UI_ListCardItem.Proxy(list.GetChildAt(0));
  445. if (listItem != null)
  446. {
  447. GuideDataManager.currentGuideId = ConstGuideId.USE_CARD_FIGHT;
  448. ShowGuide(listItem.target, true, "选择一张合适的词牌,增加过关战斗力");
  449. return;
  450. }
  451. }
  452. }
  453. }
  454. public static void TryGuideStoryCardChooseBtnConfirm(GObject target)
  455. {
  456. if (GuideDataManager.GetGuideCount(ConstGuideId.USE_CARD_FIGHT) <= 0
  457. && StoryDataManager.CheckLevelPass(2, 5)
  458. && !StoryDataManager.CheckLevelPass(2, 6))
  459. {
  460. ShowGuide(target, true, "点击确定进行战斗");
  461. }
  462. }
  463. /*****************************************************************提示标签**************************************************/
  464. public static void TryGuideStoryLevelInfoListTag(GObject target)
  465. {
  466. if (GuideDataManager.GetGuideCount(ConstGuideId.TIPS_TAGS_FIGHT) <= 0
  467. && StoryDataManager.CheckLevelPass(2, 7)
  468. && !StoryDataManager.CheckLevelPass(2, 8))
  469. {
  470. GuideDataManager.currentGuideId = ConstGuideId.TIPS_TAGS_FIGHT;
  471. ShowGuide(target, true, "选择相应的关卡标签,可提高分数", 0, true);
  472. }
  473. }
  474. /***********************************************************词牌升星********************************************************/
  475. public static void TryGuideStoryLevelInfoBtnHome(GObject target)
  476. {
  477. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  478. && StoryDataManager.CheckLevelPass(2, 14)
  479. && !StoryDataManager.CheckLevelPass(2, 15))
  480. {
  481. GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
  482. ShowGuide(target, true, "已经收集了足够的材料,可以给词牌升星了", 0, true);
  483. }
  484. }
  485. public static void TryGuideMainUIViewBtnCiPai(GObject target)
  486. {
  487. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  488. && StoryDataManager.CheckLevelPass(2, 14)
  489. && !StoryDataManager.CheckLevelPass(2, 15))
  490. {
  491. GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
  492. ShowGuide(target, true, "点击词牌", 0);
  493. }
  494. }
  495. public static void TryGuideCardDetailViewList(GList list)
  496. {
  497. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  498. && StoryDataManager.CheckLevelPass(2, 14)
  499. && !StoryDataManager.CheckLevelPass(2, 15))
  500. {
  501. if (list.numChildren > 0)
  502. {
  503. UI.Card.UI_ListCardItem listItem = UI.Card.UI_ListCardItem.Proxy(list.GetChildAt(0));
  504. if (listItem != null)
  505. {
  506. GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
  507. ShowGuide(listItem.target, true, "选择可升星的词牌", 0);
  508. return;
  509. }
  510. }
  511. }
  512. }
  513. public static void TryGuideCardFosterViewBtnStar(GObject target)
  514. {
  515. if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
  516. && StoryDataManager.CheckLevelPass(2, 14)
  517. && !StoryDataManager.CheckLevelPass(2, 15))
  518. {
  519. ShowGuide(target, true, "升满5星后,可解锁词牌的隐藏卡面哦", 0);
  520. }
  521. }
  522. /***********************************************************引导拍照********************************************************/
  523. // PHOTOGRAPH_GUIDE
  524. public static bool TryGuideGoBackStoryChapter1(GObject target)
  525. {
  526. if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
  527. && StoryDataManager.CheckLevelPass(2, 4)
  528. && !StoryDataManager.CheckLevelPass(2, 5))
  529. {
  530. GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
  531. ShowGuide(target, false, "拍照功能已开启,解锁更多搭配和玩法哦,点这里看看吧", 0);
  532. return true;
  533. }
  534. return false;
  535. }
  536. public static bool TryGuideOpenDressUpView(GObject target)
  537. {
  538. if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
  539. && StoryDataManager.CheckLevelPass(2, 4)
  540. && !StoryDataManager.CheckLevelPass(2, 5))
  541. {
  542. GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
  543. ShowGuide(target, false, "点击自由换装", 0);
  544. return true;
  545. }
  546. return false;
  547. }
  548. public static bool TryGuideDressUpViewMenuType2(GObject target)
  549. {
  550. if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
  551. && StoryDataManager.CheckLevelPass(2, 4)
  552. && !StoryDataManager.CheckLevelPass(2, 5))
  553. {
  554. GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
  555. ShowGuide(target, false, "点击拍照", 0);
  556. return true;
  557. }
  558. return false;
  559. }
  560. public static void TryGuideDressUpViewMenuPart1(GObject target)
  561. {
  562. if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
  563. && StoryDataManager.CheckLevelPass(2, 4)
  564. && !StoryDataManager.CheckLevelPass(2, 5))
  565. {
  566. GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
  567. ShowGuide(target, false, "可以自由添加已有道具", 0);
  568. }
  569. }
  570. public static bool TryGuideBtnPhotograph(GObject target)
  571. {
  572. if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
  573. && StoryDataManager.CheckLevelPass(2, 4)
  574. && !StoryDataManager.CheckLevelPass(2, 5))
  575. {
  576. GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
  577. ShowGuide(target, false, "点击空白处查看整体效果", 0);
  578. return true;
  579. }
  580. return false;
  581. }
  582. public static bool TryGuideOpenPhotographView(GObject target)
  583. {
  584. if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
  585. && StoryDataManager.CheckLevelPass(2, 4)
  586. && !StoryDataManager.CheckLevelPass(2, 5))
  587. {
  588. GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
  589. ShowGuide(target, false, "双指可控制放大缩小,或点击边框上的按键控制", 0);
  590. return true;
  591. }
  592. return false;
  593. }
  594. public static bool TryGuideBtnSave(GObject target)
  595. {
  596. if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
  597. && StoryDataManager.CheckLevelPass(2, 4)
  598. && !StoryDataManager.CheckLevelPass(2, 5))
  599. {
  600. GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
  601. ShowGuide(target, false, "点击拍照,可以记录和分享美照啦~", 0);
  602. return true;
  603. }
  604. return false;
  605. }
  606. /*********************************************************************************************************************************/
  607. public static bool useNewGuide = true;
  608. public static bool TryGuide(GObject target, string guideKey, int index, string guideStr = null, bool isList = false, int listIndex = 0, bool checkIndex = true, bool needUpdate = false, int yTxt = 0, float devWidth = 0, float devHeight = 0)
  609. {
  610. if (!useNewGuide) return false;
  611. GuideCfg cfg = GuideCfgArray.Instance.GetCfg(guideKey);
  612. if ((GuideDataManager.GetGuideCountCopy(guideKey) <= 0
  613. && (!checkIndex || checkIndex && GuideDataManager.IsGuideIndexFinish(cfg.id, index - 1) == true && GuideDataManager.IsGuideIndexFinish(cfg.id, index) == false)
  614. && (GuideDataManager.currentGuideId == 0 || GuideDataManager.currentGuideId == cfg.id && GuideDataManager.currentGuideIdIndex != index)
  615. && (StoryDataManager.currentChapter == 0 || StoryDataManager.CheckCurrentLevelPass() == false)
  616. && StoryDataManager.CheckLevelPass(cfg.chapterId, cfg.level - 1)
  617. && !StoryDataManager.CheckLevelPass(cfg.chapterId, cfg.level))
  618. ||
  619. (cfg.chapterId == 0
  620. && GuideDataManager.GetGuideCountCopy(guideKey) <= 0
  621. ))
  622. {
  623. GuideDataManager.currentGuideId = cfg.id;
  624. GuideDataManager.currentGuideIdIndex = index;
  625. GuideDataManager.SetGuideIndex(cfg.id, index);
  626. if (isList)
  627. {
  628. if (target.asList.numItems > 0)
  629. {
  630. GObject item = (target.asList).GetChildAt(listIndex);
  631. if (item != null)
  632. {
  633. target = item;
  634. // target.asList.ScrollToView(listIndex);
  635. }
  636. }
  637. else
  638. {
  639. return false;
  640. }
  641. }
  642. ShowGuideIndex(target, needUpdate, guideStr, yTxt, cfg.optionalGuide == 1, devWidth, devHeight, GuideDataManager.currentGuideId, GuideDataManager.currentGuideIdIndex);
  643. if (!checkIndex)
  644. {
  645. for (int i = 1; i < index; i++)
  646. {
  647. GuideDataManager.TryCompleteGuideIndex(cfg.id, i, false);
  648. }
  649. }
  650. return true;
  651. }
  652. return false;
  653. }
  654. private static void ShowGuideIndex(GObject target, bool needUpdate = false, string guideStr = null, int yTxt = 0, bool isOptionalGuide = false, float devWidth = 0, float devHeight = 0, int guideId = 0, int index = 0)
  655. {
  656. HideGuideIndex();
  657. if (GameGlobal.skipGuide)
  658. {
  659. return;
  660. }
  661. ViewManager.Show(ViewName.GUIDE_VIEW, new List<object> { target, needUpdate, guideStr, yTxt, isOptionalGuide, devWidth, devHeight, guideId, index });
  662. }
  663. public static bool TryCompleteGuideIndex(int guideId, int index)
  664. {
  665. if (!useNewGuide) return false;
  666. HideGuideIndex();
  667. // bool result = GuideDataManager.TryCompleteGuideIndex(guideId, index);
  668. if (GuideDataManager.TryCompleteGuideIndex(guideId, index))
  669. {
  670. return true;
  671. }
  672. return false;
  673. }
  674. public static bool TryCompleteGuide(string guideKey, int count)
  675. {
  676. if (!useNewGuide) return false;
  677. GuideCfg cfg = GuideCfgArray.Instance.GetCfg(guideKey);
  678. if (!GuideDataManager.CheckAllIndexFinish(cfg.id, count)) return false;
  679. bool result = GuideDataManager.TryCompleteGuide(cfg.id);
  680. if (result)
  681. {
  682. GuideDataManager.currentGuideId = 0;
  683. HideGuideIndex();
  684. }
  685. return result;
  686. }
  687. public static void HideGuideIndex()
  688. {
  689. if (!useNewGuide) return;
  690. ViewManager.Hide(ViewName.GUIDE_VIEW);
  691. }
  692. /************************************************************************************************************/
  693. public static bool TryGuideByGuideId(GObject target, int guideId, int maxCount = 1, bool needUpdate = false, string guideStr = null, int yTxt = 0, int preGuideIdAtThisLogin = 0)
  694. {
  695. if (GuideController.useNewGuide) return false;
  696. if (preGuideIdAtThisLogin > 0 && !GuideDataManager.CheckGuideIsCompletedAtThisLogin(preGuideIdAtThisLogin))
  697. {
  698. return false;
  699. }
  700. if (GuideDataManager.GetGuideCount(guideId) < maxCount)
  701. {
  702. GuideDataManager.currentGuideId = guideId;
  703. ShowGuide(target, needUpdate, guideStr, yTxt);
  704. return true;
  705. }
  706. return false;
  707. }
  708. public static bool TryCompleteGuide(int guideId)
  709. {
  710. if (useNewGuide) return false;
  711. bool result = GuideDataManager.TryCompleteGuide(guideId);
  712. if (result)
  713. {
  714. HideGuide();
  715. }
  716. return result;
  717. }
  718. public static void HideGuide()
  719. {
  720. if (useNewGuide) return;
  721. ViewManager.Hide(ViewName.GUIDE_VIEW);
  722. }
  723. private static void ShowGuide(GObject target, bool needUpdate = false, string guideStr = null, int yTxt = 0, bool isOptionalGuide = false, float devWidth = 0, float devHeight = 0)
  724. {
  725. if (useNewGuide) return;
  726. HideGuide();
  727. if (GameGlobal.skipGuide)
  728. {
  729. return;
  730. }
  731. ViewManager.Show(ViewName.GUIDE_VIEW, new List<object> { target, needUpdate, guideStr, yTxt, isOptionalGuide, devWidth, devHeight
  732. });
  733. }
  734. }
  735. }