Phase4.cs 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. using Fort23.Core;
  2. using Fort23.UTool;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace Fort23.Mono.Phases
  6. {
  7. public class Phase4 : IGuideLogic
  8. {
  9. public PlayerGuideManager pgm;
  10. public BetterList<string> dialogList = new BetterList<string>();
  11. private bool once = false;
  12. public Phase4(PlayerGuideManager guideManager)
  13. {
  14. this.pgm = guideManager;
  15. once = true;
  16. }
  17. public override void Active()
  18. {
  19. base.Active();
  20. actionList.Add(OnStep401);
  21. actionList.Add(OnStep402);
  22. actionList.Add(OnStep403);
  23. actionList.Add(OnStep404);
  24. actionList.Add(OnStep405);
  25. actionList.Add(OnStep406);
  26. actionList.Add(OnStep407);
  27. actionList.Add(OnStep408);
  28. actionList.Add(OnStepEnd);
  29. }
  30. public override void Begin()
  31. {
  32. guideID = 4;
  33. guideIdx = -1;
  34. pgm.isForceDone = false;
  35. pgm.isTriggerDone = false;
  36. }
  37. public override void End()
  38. {
  39. }
  40. public override async CTask Guide()
  41. {
  42. if (actionList.Count > guideIdx)
  43. {
  44. pgm.ResetPlayerGuide();
  45. guideIdx++;
  46. SaveStep(guideIdx);
  47. await actionList[guideIdx](null);
  48. }
  49. else
  50. {
  51. LogTool.Error("没有引导了,强制结束。出错步骤,:" + pgm.curPhase + guideIdx);
  52. pgm.isForceDone = true;
  53. }
  54. }
  55. public override void LogicRelase()
  56. {
  57. actionList.Clear();
  58. }
  59. public override void LogicUpdate()
  60. {
  61. }
  62. /// <summary>
  63. /// 点击功法
  64. /// </summary>
  65. /// <param name="obj"></param>
  66. public async CTask OnStep401(UnityEngine.Object obj)
  67. {
  68. pgm.StepInit();
  69. GameObject gameObject = UIManager.Instance.GetComponent<AppBarPanel>().Btn_GongFa.gameObject;
  70. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  71. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  72. localPos = new Vector2(-30, -755);
  73. size = new Vector2(78, 97);
  74. pgm.SetfxTransVisiable(true);
  75. pgm.SetMaskTarget(gameObject);
  76. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  77. await pgm.ConfigLogic(401, delegate() { });
  78. pgm.SetFingerPos(localPos);
  79. pgm.SetFingerVisiable(true);
  80. }
  81. /// <summary>
  82. /// 框选功法
  83. /// </summary>
  84. /// <param name="obj"></param>
  85. public async CTask OnStep402(UnityEngine.Object obj)
  86. {
  87. pgm.StepInit();
  88. await TimerComponent.Instance.WaitAsync(100);
  89. Vector2 size = new Vector2(735, 785);
  90. Vector3 localPos = new Vector2(0, -279);
  91. pgm.SetfxTransVisiable(true);
  92. pgm.SetShowFramePosAndSize(localPos, size, 0, null);
  93. await pgm.ConfigLogic(402, delegate() { pgm.NextGuide(); });
  94. pgm.SetFingerPos(localPos);
  95. pgm.SetFingerVisiable(true);
  96. }
  97. /// <summary>
  98. /// 框选功法盘
  99. /// </summary>
  100. /// <param name="obj"></param>
  101. public async CTask OnStep403(UnityEngine.Object obj)
  102. {
  103. pgm.StepInit();
  104. await TimerComponent.Instance.WaitAsync(100);
  105. pgm.SetfxTransVisiable(true);
  106. Vector2 size = new Vector2(743, 690);
  107. Vector2 localPos = new Vector2(0, 461);
  108. pgm.SetShowFramePosAndSize(localPos, size, 0, null);
  109. await pgm.ConfigLogic(403, delegate() { pgm.NextGuide(); });
  110. pgm.SetFingerPos(localPos);
  111. pgm.SetFingerVisiable(true);
  112. }
  113. /// <summary>
  114. /// 点击调整
  115. /// </summary>
  116. /// <param name="obj"></param>
  117. public async CTask OnStep404(UnityEngine.Object obj)
  118. {
  119. pgm.StepInit();
  120. await TimerComponent.Instance.WaitAsync(100);
  121. GameObject gameObject =
  122. UIManager.Instance.GetComponent<SkillSelectPanel>().Btn_Setting.gameObject;
  123. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  124. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  125. pgm.SetfxTransVisiable(true);
  126. pgm.SetMaskTarget(gameObject);
  127. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  128. await pgm.ConfigLogic(404, delegate() { });
  129. pgm.SetFingerPos(localPos);
  130. pgm.SetFingerVisiable(true);
  131. }
  132. /// <summary>
  133. /// 点击第二个功法
  134. /// </summary>
  135. /// <param name="obj"></param>
  136. public async CTask OnStep405(UnityEngine.Object obj)
  137. {
  138. pgm.StepInit();
  139. await TimerComponent.Instance.WaitAsync(100);
  140. GameObject gameObject =
  141. UIManager.Instance.GetComponent<SkillSelectPanel>()._skillWidgets[1].own;
  142. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  143. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  144. pgm.SetfxTransVisiable(true);
  145. pgm.SetMaskTarget(gameObject);
  146. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  147. await pgm.ConfigLogic(405, delegate() { });
  148. pgm.SetFingerPos(pgm.Setpos(localPos, size, gameObject));
  149. pgm.SetFingerVisiable(true);
  150. }
  151. /// <summary>
  152. /// 对话
  153. /// </summary>
  154. /// <param name="obj"></param>
  155. public async CTask OnStep406(UnityEngine.Object obj)
  156. {
  157. pgm.StepInit();
  158. await TimerComponent.Instance.WaitAsync(100);
  159. await pgm.ConfigLogic(406, delegate() { pgm.NextGuide(); });
  160. }
  161. /// <summary>
  162. /// 这是个{火}功法,把他放在功法盘{火}的附近,会优先释放
  163. /// </summary>
  164. /// <param name="obj"></param>
  165. public async CTask OnStep407(UnityEngine.Object obj)
  166. {
  167. pgm.StepInit();
  168. await TimerComponent.Instance.WaitAsync(100);
  169. GameObject gameObject =
  170. UIManager.Instance.GetComponent<SkillSelectPanel>().allKongSkill[6].own;
  171. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  172. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  173. pgm.SetfxTransVisiable(true);
  174. pgm.SetMaskTarget(gameObject);
  175. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  176. await pgm.ConfigLogic(407, delegate() { });
  177. pgm.SetFingerPos(pgm.Setpos(localPos, size, gameObject));
  178. pgm.SetFingerVisiable(true);
  179. }
  180. /// <summary>
  181. /// 功法调整完毕,点这里返回
  182. /// </summary>
  183. /// <param name="obj"></param>
  184. public async CTask OnStep408(UnityEngine.Object obj)
  185. {
  186. pgm.StepInit();
  187. await TimerComponent.Instance.WaitAsync(100);
  188. GameObject gameObject =
  189. UIManager.Instance.GetComponent<SkillSelectPanel>().guanbi.gameObject;
  190. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  191. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  192. pgm.SetfxTransVisiable(true);
  193. pgm.SetMaskTarget(gameObject);
  194. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  195. await pgm.ConfigLogic(408, delegate() { });
  196. pgm.SetFingerPos(pgm.Setpos(localPos, size, gameObject));
  197. pgm.SetFingerVisiable(true);
  198. }
  199. public async CTask OnStepEnd(UnityEngine.Object obj)
  200. {
  201. pgm.StepInit();
  202. pgm.SetBlackBaseVisiable(false);
  203. ForceGuideOver();
  204. }
  205. /// <summary>
  206. /// 引导完成
  207. /// </summary>
  208. private void ForceGuideOver()
  209. {
  210. pgm.CloseForceGuide();
  211. pgm.RestGuide();
  212. }
  213. }
  214. }