ManaTutorial.cs 19 KB

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