ManaTutorial.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. public class ManaTutorial : Regist
  6. {
  7. #region 变量
  8. public static bool PayExempt
  9. {
  10. get
  11. {
  12. if (PayExempt_)
  13. {
  14. return true;
  15. }
  16. else
  17. {
  18. if (PayExemptAmt > 0)
  19. {
  20. PayExemptAmt--;
  21. return true;
  22. }
  23. else
  24. {
  25. return false;
  26. }
  27. }
  28. }
  29. set { PayExempt_ = value; }
  30. }
  31. public static bool ConnectExempt
  32. {
  33. get
  34. {
  35. if (ConnectExempt_)
  36. {
  37. return true;
  38. }
  39. else
  40. {
  41. if (ConnectExemptAmt > 0)
  42. {
  43. ConnectExemptAmt--;
  44. return true;
  45. }
  46. else
  47. {
  48. return false;
  49. }
  50. }
  51. }
  52. set { ConnectExempt_ = value; }
  53. }
  54. public static bool PayExempt_;
  55. public static bool ConnectExempt_;
  56. public static bool TutorialB;
  57. public static bool TutorialB_;
  58. public static int TutorialIndexA;
  59. public static int TutorialIndexB;
  60. public static int PayExemptAmt;
  61. public static int ConnectExemptAmt;
  62. public static bool TutorialA;
  63. #endregion
  64. public override void Instantiate()
  65. {
  66. if (TutorialA)
  67. {
  68. ManaReso.Get<ObjRoot>("Tutorial", Folder.Scene, true, transform, false, ObjType.Tutorial).AddScript<Tutorial>();
  69. }
  70. }
  71. public override void RegistValueC()
  72. {
  73. Tutorial.Arrow = ManaReso.Get("N_Arrow");
  74. Tutorial.Material = ManaReso.Get<Image>("N_Mask").material;
  75. if (TutorialA)
  76. {
  77. ManaReso.Get("TutorialMask").AddScript<SceneMask>();
  78. ManaReso.Get("Tutorial").CreateTweenSr(0, 1, 1f, true, true, Curve.EaseOutQuad, false, true);
  79. ManaReso.Get("PlayerBk1").CreateTweenScale(new Vector3(0.75f, 0.75f, 0.75f), new Vector3(0.9f, 0.9f, 0.9f), 0.25f, true, true, Curve.EaseOutQuad);
  80. ManaReso.Get("PlayerBk2").CreateTweenScale(new Vector3(0.75f, 0.75f, 0.75f), new Vector3(0.9f, 0.9f, 0.9f), 0.25f, true, true, Curve.EaseOutQuad);
  81. ManaReso.Get("PlayerBk3").CreateTweenScale(new Vector3(0.75f, 0.75f, 0.75f), new Vector3(0.9f, 0.9f, 0.9f), 0.25f, true, true, Curve.EaseOutQuad);
  82. ManaReso.Get("TutorialMask").CreateTweenSr(0, 180 / 255f, 0.25f, false, true, Curve.EaseOutQuad);
  83. if (TutorialIndexA == 1)
  84. {
  85. PrepareStep1();
  86. }
  87. else if (TutorialIndexA == 2)
  88. {
  89. Garden.Instance.TutorialToRegular();
  90. PrepareStep2();
  91. }
  92. else if (TutorialIndexA == 4)
  93. {
  94. ManaReso.SetActive("N_Tutorial", true);
  95. ManaReso.SetActive("Tutorial", true);
  96. ManaReso.SetActive("TutorialMask", true);
  97. ManaReso.SetActive("TutorialCollider", true);
  98. Garden.Instance.TutorialToRegular();
  99. ManaUI.Instance.TutorialToRegular();
  100. Transform tra = ManaGarden.SlotList[0].transform;
  101. Tutorial.HightScene(0.1f, 0.075f, tra.FindChild("SlotArrow"), tra);
  102. }
  103. else if (TutorialIndexA == 6)
  104. {
  105. Garden.Instance.TutorialToRegular();
  106. ManaUI.Instance.TutorialToRegular();
  107. PrepareStep6();
  108. }
  109. }
  110. }
  111. public static void EndStep1()
  112. {
  113. Garden.Instance.TutorialToRegular();
  114. Destroy(ManaReso.Get("PlayerBk1").gameObject);
  115. Destroy(ManaReso.Get("PlayerBk2").gameObject);
  116. Destroy(ManaReso.Get("PlayerBk3").gameObject);
  117. PrepareStep2();
  118. }
  119. public static void EndStep2()
  120. {
  121. Tutorial.HightDisable();
  122. PrepareStep3();
  123. }
  124. public static void EndStep3()
  125. {
  126. Tutorial.HightDisable();
  127. ManaReso.SetActive("D_Quit", true);
  128. PrepareStep4();
  129. }
  130. public static void EndStep4()
  131. {
  132. Tutorial.HightDisable();
  133. PrepareStep5();
  134. }
  135. public static void EndStep5()
  136. {
  137. PrepareStep6();
  138. }
  139. public static void EndStep6()
  140. {
  141. Tutorial.HightDisable();
  142. PrepareStep7();
  143. }
  144. public static void EndStep7()
  145. {
  146. Tutorial.HightDisable(0, true);
  147. PrepareStep8();
  148. }
  149. public static void EndStep8()
  150. {
  151. Tutorial.HightDisable(0, true);
  152. PrepareStep9();
  153. }
  154. public static void EndStep9()
  155. {
  156. TutorialA = false;
  157. Tutorial.HightDisable();
  158. ManaReso.SetActive("Tutorial", false);
  159. ManaReso.SetActive("N_Tutorial", false);
  160. }
  161. public static void PrepareStep1()
  162. {
  163. TutorialIndexA = 1;
  164. ManaReso.Get("PlayerBk2").TweenForScale();
  165. ManaReso.SetActive("PlayerBk1", true);
  166. ManaReso.SetActive("PlayerBk2", true);
  167. ManaReso.SetActive("PlayerBk3", true);
  168. ManaReso.SetActive("TutorialMask", true);
  169. ManaReso.SetActive("TutorialCollider", true);
  170. ManaReso.SetActive("N_Tutorial", true);
  171. ManaReso.SetActive("N_Confirm", true);
  172. ManaReso.AddButtonEventOnetime
  173. (
  174. "N_Confirm",
  175. () =>
  176. {
  177. Transform tra = ManaPlayer.SelePlayerTra;
  178. ManaPlayer.Player = tra.GetComponent<Player>();
  179. tra.parent = ManaReso.Get("Garden");
  180. ManaReso.TraDic.Add(tra.name, tra);
  181. ManaAudio.PlayClip(Clip.BtnClip);
  182. tra.CreateTweenScale(ManaReso.Get("PlayerPosTra").localScale, 1f, true, true, Curve.EaseOutQuad);
  183. tra.CreateTweenVec3D(ManaReso.Get("PlayerPosTra").position, 1f, false, true, true, Curve.EaseOutQuad);
  184. tra.TweenForVec();
  185. tra.TweenForScale();
  186. ManaReso.Get("N_Confirm").TweenBacCG();
  187. Tween tween = ManaReso.Get("Tutorial").TweenBacSr();
  188. tween.AddEventOnetime
  189. (
  190. EventType.BackwardFinish,
  191. () =>
  192. {
  193. EndStep1();
  194. }
  195. );
  196. }
  197. );
  198. }
  199. public static void PrepareStep2()
  200. {
  201. TutorialIndexA = 2;
  202. ManaUI.Instance.TutorialToRegular();
  203. ManaReso.Get("C_Main").TweenForCG();
  204. ManaReso.Get("C_MiniGame").TweenForCG();
  205. ManaReso.SetActive("C_Coin", false);
  206. ManaReso.SetActive("C_Setting", false);
  207. ManaReso.SetActive("C_Achieve", false);
  208. ManaReso.SetActive("C_Manage", false);
  209. ManaReso.SetActive("N_Tutorial", true);
  210. Tween tween = ManaReso.Get("N_Mask").TweenConForGra();
  211. tween.AddEventOnetime
  212. (
  213. EventType.ForwardFinish,
  214. () =>
  215. {
  216. Tutorial.HightScreen(ManaReso.Get("C_MiniArrow0"), ManaReso.Get("C_MiniArrow1"), ManaReso.Get("C_MiniGame"));
  217. }
  218. );
  219. ManaReso.AddButtonEventOnetime
  220. (
  221. "C_MiniGame",
  222. () =>
  223. {
  224. EndStep2();
  225. }
  226. );
  227. }
  228. public static void PrepareStep3()
  229. {
  230. ManaReso.Get("Tutorial").SetCollider(false);
  231. ManaReso.SetActive("D_Quit", false);
  232. Tween tween = ManaReso.Get("D_MiniGame").GetTweenCG();
  233. tween.AddEventOnetime
  234. (
  235. EventType.ForwardFinish,
  236. () =>
  237. {
  238. Tutorial.HightScreen(ManaReso.Get("D_BeginArrow0"), ManaReso.Get("D_BeginArrow1"), ManaReso.Get("D_Begin"));
  239. }
  240. );
  241. ManaReso.PushButtonEventOnetime
  242. (
  243. "D_Begin",
  244. () =>
  245. {
  246. Tutorial.HightDisable();
  247. }
  248. );
  249. ManaReso.AddButtonEventOnetime
  250. (
  251. "Da_GetAward",
  252. () =>
  253. {
  254. EndStep3();
  255. }
  256. );
  257. }
  258. public static void PrepareStep4()
  259. {
  260. TutorialIndexA = 4;
  261. Tween tween = ManaReso.Get("D_MiniGame").GetTweenCG();
  262. tween.AddEventOnetime
  263. (
  264. EventType.BackwardFinish,
  265. () =>
  266. {
  267. ManaReso.Get("Tutorial").SetCollider(true);
  268. ManaReso.Get<SpriteRenderer>("TutorialMask").material.SetColor("_Color", Color.white);
  269. ManaReso.SetActive("TutorialMask", true);
  270. ManaReso.SetActive("TutorialCollider", true);
  271. Transform tra = ManaGarden.SlotList[0].transform;
  272. Tutorial.HightScene(0.1f, 0.075f, tra.FindChild("SlotArrow"), tra);
  273. }
  274. );
  275. }
  276. public static void PrepareStep5()
  277. {
  278. Tween tween = ManaReso.Get("G_Flower").TweenForCG();
  279. tween.AddEventOnetime
  280. (
  281. EventType.ForwardFinish,
  282. () =>
  283. {
  284. Transform tra = ManaReso.Get("G_RegularGrid").GetChild(0);
  285. Tutorial.HightScreen(tra.FindChild("Arrow0"), tra);
  286. }
  287. );
  288. FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic[1];
  289. flowerInfo.Button.AddButtonEventOnetime
  290. (
  291. () =>
  292. {
  293. Tutorial.HightDisable(0, false);
  294. Tutorial.HightScreen(ManaReso.Get("G_Arrow0"), ManaReso.Get("G_Close"));
  295. }
  296. );
  297. ManaReso.AddButtonEventOnetime
  298. (
  299. "G_Close",
  300. () =>
  301. {
  302. Tutorial.HightDisable();
  303. }
  304. );
  305. tween.AddEventOnetime
  306. (
  307. EventType.BackwardFinish,
  308. () =>
  309. {
  310. EndStep5();
  311. }
  312. );
  313. }
  314. public static void PrepareStep6()
  315. {
  316. TutorialIndexA = 6;
  317. ManaReso.SetActive("C_Coin", true);
  318. ManaReso.SetActive("C_Setting", true);
  319. ManaReso.SetActive("C_Achieve", true);
  320. ManaReso.SetActive("C_Manage", true);
  321. ManaReso.SetActive("N_Tutorial", true);
  322. Tween tween = ManaReso.Get("C_Main").TweenForCG();
  323. tween.AddEventOnetime
  324. (
  325. EventType.ForwardFinish, () =>
  326. {
  327. Tutorial.HightScreen(ManaReso.Get("C_ManageArrow0"), ManaReso.Get("C_Manage"));
  328. }
  329. );
  330. ManaReso.AddButtonEventOnetime
  331. (
  332. "C_Manage",
  333. () =>
  334. {
  335. EndStep6();
  336. }
  337. );
  338. }
  339. public static void PrepareStep7()
  340. {
  341. Tween tween = ManaReso.Get("F_Manage0").GetTweenVec();
  342. tween.AddEventOnetime
  343. (
  344. EventType.ForwardFinish,
  345. () =>
  346. {
  347. Transform tra = ManaData.SkillDic["Ability1"].SkillItem;
  348. Tutorial.HightScreen(tra.FindChild("Arrow0"), tra.FindChild("Arrow1"), tra.FindChild("Btn"));
  349. }
  350. );
  351. SkillRoot skill = ManaData.SkillDic["Ability1"];
  352. skill.ItemBtn.AddButtonEventOnetime
  353. (
  354. () =>
  355. {
  356. Tutorial.HightDisable(0, true);
  357. }
  358. );
  359. tween = ManaReso.Get("Fe_Info").GetTweenCG();
  360. tween.AddEventOnetime
  361. (
  362. EventType.ForwardFinish,
  363. () =>
  364. {
  365. Tutorial.HightScreen(ManaReso.Get("Fe_Arrow0"), ManaReso.Get("Fe_Arrow1"), ManaReso.Get("Fe_Btn"));
  366. ManaReso.AddButtonEventOnetime
  367. (
  368. "Fe_Btn",
  369. EndStep7
  370. );
  371. }
  372. );
  373. }
  374. public static void PrepareStep8()
  375. {
  376. Tween tween = ManaReso.Get("Fe_Info").GetTweenCG();
  377. tween.AddEventOnetime
  378. (
  379. EventType.BackwardFinish,
  380. () =>
  381. {
  382. Transform tra = ManaData.SkillDic["Skill1"].SkillItem;
  383. Tutorial.HightScreen(tra.FindChild("Arrow0"), tra.FindChild("Arrow1"), tra.FindChild("Btn"));
  384. }
  385. );
  386. SkillRoot skill = ManaData.SkillDic["Skill1"];
  387. skill.ItemBtn.AddButtonEventOnetime
  388. (
  389. () =>
  390. {
  391. Tutorial.HightDisable(0, true);
  392. }
  393. );
  394. tween = ManaReso.Get("Fe_Info").GetTweenCG();
  395. tween.AddEventOnetime
  396. (
  397. EventType.ForwardFinish,
  398. () =>
  399. {
  400. Tutorial.HightScreen(ManaReso.Get("Fe_Arrow0"), ManaReso.Get("Fe_Arrow1"), ManaReso.Get("Fe_Btn"));
  401. ManaReso.AddButtonEventOnetime
  402. (
  403. "Fe_Btn",
  404. EndStep8
  405. );
  406. }
  407. );
  408. }
  409. public static void PrepareStep9()
  410. {
  411. Tween tween = ManaReso.Get("Fe_Info").GetTweenCG();
  412. tween.AddEventOnetime
  413. (
  414. EventType.BackwardFinish,
  415. () =>
  416. {
  417. ConnectExemptAmt = 1;
  418. Tutorial.HightScreen(ManaReso.Get("F_Arrow0"), ManaReso.Get("F_Skill1"));
  419. }
  420. );
  421. ManaReso.AddButtonEventOnetime
  422. (
  423. "F_SkillBk11",
  424. () =>
  425. {
  426. EndStep9();
  427. ConnectExemptAmt = 0;
  428. }
  429. );
  430. }
  431. public static void EndStep10()
  432. {
  433. Tutorial.HightDisable();
  434. }
  435. public static void EndStep11()
  436. {
  437. Tutorial.HightDisable();
  438. TutorialB = false;
  439. }
  440. public static void PrepareStep10()
  441. {
  442. TutorialB = false;
  443. TutorialB_ = false;
  444. ManaReso.Get("N_Mask").TweenForGra();
  445. ManaReso.Get("Fe_Info").TweenBacCG();
  446. ManaReso.SetActive("N_Tutorial", true);
  447. Ability skill = (Ability) ManaData.SkillDic["Ability2"];
  448. if (skill.ItemStatus == SkillStatus.Upgrade)
  449. {
  450. PrepareStepB11();
  451. }
  452. else
  453. {
  454. Move move = ManaReso.Get<ScrollRect>("Fa_Scrr").Locate(skill.SkillItem, 1, Curve.EaseOutQuad, LocatePos.Middle);
  455. move.AddEventOnetime
  456. (
  457. EventType.ForwardFinish,
  458. () =>
  459. {
  460. Tutorial.HightScreen(skill.SkillItem.FindChild("Arrow0"), skill.SkillItem.FindChild("Arrow1"), skill.SkillItem.FindChild("Btn"));
  461. }
  462. );
  463. skill.ItemBtn.AddButtonEventOnetime
  464. (
  465. () =>
  466. {
  467. Tutorial.HightDisable(0, true);
  468. }
  469. );
  470. Tween tween = ManaReso.Get("Fe_Info").GetTweenCG();
  471. tween.AddEventOnetime
  472. (
  473. EventType.ForwardFinish,
  474. () =>
  475. {
  476. Tutorial.HightScreen(ManaReso.Get("Fe_Arrow0"), ManaReso.Get("Fe_Arrow1"), ManaReso.Get("Fe_Btn"));
  477. ManaReso.AddButtonEventOnetime
  478. (
  479. "Fe_Btn",
  480. () =>
  481. {
  482. EndStep10();
  483. move = ManaReso.Get("MainCamera").CreateZoom2D();
  484. move.AddEventOnetime
  485. (
  486. EventType.ForwardFinish,
  487. () =>
  488. {
  489. PrepareStepA11();
  490. }
  491. );
  492. }
  493. );
  494. }
  495. );
  496. }
  497. }
  498. public static void PrepareStepA11()
  499. {
  500. ManaReso.Get("N_Mask").TweenForGra();
  501. Tween tween = ManaReso.Get("F_Manage0").TweenForVec();
  502. tween.AddEventOnetime
  503. (
  504. EventType.ForwardFinish,
  505. () =>
  506. {
  507. Auxiliary.Instance.DelayCall
  508. (
  509. () =>
  510. {
  511. ManaReso.Get<Button>("F_Elf").onClick.Invoke();
  512. },
  513. 0.25f
  514. );
  515. Auxiliary.Instance.DelayCall
  516. (
  517. () =>
  518. {
  519. Transform item = ManaData.SkillDic["Ability5"].SkillItem;
  520. Tutorial.HightScreen(item.FindChild("Arrow0"), item.FindChild("Arrow1"), item.FindChild("Btn"));
  521. },
  522. 0.5f
  523. );
  524. }
  525. );
  526. Ability skill = (Ability) ManaData.SkillDic["Ability5"];
  527. skill.ItemBtn.AddButtonEventOnetime
  528. (
  529. () =>
  530. {
  531. Tutorial.HightDisable(0, false);
  532. }
  533. );
  534. tween = ManaReso.Get("Fe_Info").GetTweenCG();
  535. tween.AddEventOnetime
  536. (
  537. EventType.ForwardFinish,
  538. () =>
  539. {
  540. Tutorial.HightScreen(ManaReso.Get("Fe_Arrow0"), ManaReso.Get("Fe_Arrow1"), ManaReso.Get("Fe_Btn"));
  541. ManaReso.AddButtonEventOnetime
  542. (
  543. "Fe_Btn",
  544. () =>
  545. {
  546. EndStep11();
  547. }
  548. );
  549. }
  550. );
  551. }
  552. public static void PrepareStepB11()
  553. {
  554. Tween tween = ManaReso.Get("Fe_Info").TweenBacCG();
  555. tween.AddEventOnetime
  556. (
  557. EventType.BackwardFinish,
  558. () =>
  559. {
  560. Auxiliary.Instance.DelayCall
  561. (
  562. () =>
  563. {
  564. ManaReso.Get<Button>("F_Elf").onClick.Invoke();
  565. },
  566. 0.25f
  567. );
  568. Auxiliary.Instance.DelayCall
  569. (
  570. () =>
  571. {
  572. Transform item = ManaData.SkillDic["Ability5"].SkillItem;
  573. Tutorial.HightScreen(item.FindChild("Arrow0"), item.FindChild("Arrow1"), item.FindChild("Btn"));
  574. },
  575. 0.5f
  576. );
  577. }
  578. );
  579. Ability skill = (Ability)ManaData.SkillDic["Ability5"];
  580. skill.ItemBtn.AddButtonEventOnetime
  581. (
  582. () =>
  583. {
  584. Tutorial.HightDisable(0, false);
  585. }
  586. );
  587. tween = ManaReso.Get("Fe_Info").GetTweenCG();
  588. tween.AddEventOnetime
  589. (
  590. EventType.ForwardFinish,
  591. () =>
  592. {
  593. Tutorial.HightScreen(ManaReso.Get("Fe_Arrow0"), ManaReso.Get("Fe_Arrow1"), ManaReso.Get("Fe_Btn"));
  594. ManaReso.AddButtonEventOnetime
  595. (
  596. "Fe_Btn",
  597. () =>
  598. {
  599. EndStep11();
  600. }
  601. );
  602. }
  603. );
  604. }
  605. }