Phase4.cs 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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(OnStep409);
  29. actionList.Add(OnStep410);
  30. actionList.Add(OnStepEnd);
  31. }
  32. public override void Begin()
  33. {
  34. guideID = 4;
  35. guideIdx = -1;
  36. pgm.isForceDone = false;
  37. pgm.isTriggerDone = false;
  38. }
  39. public override void End()
  40. {
  41. }
  42. public override async CTask Guide()
  43. {
  44. if (actionList.Count > guideIdx)
  45. {
  46. pgm.ResetPlayerGuide();
  47. guideIdx++;
  48. SaveStep(guideIdx);
  49. await actionList[guideIdx](null);
  50. }
  51. else
  52. {
  53. LogTool.Error("没有引导了,强制结束。出错步骤,:" + pgm.curPhase + guideIdx);
  54. pgm.isForceDone = true;
  55. }
  56. }
  57. public override void LogicRelase()
  58. {
  59. actionList.Clear();
  60. }
  61. public override void LogicUpdate()
  62. {
  63. }
  64. /// <summary>
  65. /// 点击功法
  66. /// </summary>
  67. /// <param name="obj"></param>
  68. public async CTask OnStep401(UnityEngine.Object obj)
  69. {
  70. pgm.StepInit();
  71. GameObject gameObject = UIManager.Instance.GetComponent<AppBarPanel>().Btn_GongFa.gameObject;
  72. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  73. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  74. localPos = new Vector2(-30, -755);
  75. size = new Vector2(78, 97);
  76. pgm.SetfxTransVisiable(true);
  77. pgm.SetMaskTarget(gameObject);
  78. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  79. await pgm.ConfigLogic(401, delegate() { });
  80. pgm.SetFingerPos(localPos);
  81. pgm.SetFingerVisiable(true);
  82. }
  83. /// <summary>
  84. /// 框选功法
  85. /// </summary>
  86. /// <param name="obj"></param>
  87. public async CTask OnStep402(UnityEngine.Object obj)
  88. {
  89. pgm.StepInit();
  90. await TimerComponent.Instance.WaitAsync(100);
  91. Vector2 size = new Vector2(735, 785);
  92. Vector3 localPos = new Vector2(0, -279);
  93. pgm.SetfxTransVisiable(true);
  94. pgm.SetShowFramePosAndSize(localPos, size, 0, null);
  95. await pgm.ConfigLogic(402, delegate() { pgm.NextGuide(); });
  96. pgm.SetFingerPos(localPos);
  97. pgm.SetFingerVisiable(true);
  98. }
  99. /// <summary>
  100. /// 框选功法盘
  101. /// </summary>
  102. /// <param name="obj"></param>
  103. public async CTask OnStep403(UnityEngine.Object obj)
  104. {
  105. pgm.StepInit();
  106. await TimerComponent.Instance.WaitAsync(100);
  107. pgm.SetfxTransVisiable(true);
  108. Vector2 size = new Vector2(743, 690);
  109. Vector2 localPos = new Vector2(0, 461);
  110. pgm.SetShowFramePosAndSize(localPos, size, 0, null);
  111. await pgm.ConfigLogic(403, delegate() { pgm.NextGuide(); });
  112. pgm.SetFingerPos(localPos);
  113. pgm.SetFingerVisiable(true);
  114. }
  115. /// <summary>
  116. /// 点击调整
  117. /// </summary>
  118. /// <param name="obj"></param>
  119. public async CTask OnStep404(UnityEngine.Object obj)
  120. {
  121. pgm.StepInit();
  122. await TimerComponent.Instance.WaitAsync(100);
  123. GameObject gameObject =
  124. UIManager.Instance.GetComponent<SkillSelectPanel>().Btn_Setting.gameObject;
  125. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  126. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  127. pgm.SetfxTransVisiable(true);
  128. pgm.SetMaskTarget(gameObject);
  129. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  130. await pgm.ConfigLogic(404, delegate() { });
  131. pgm.SetFingerPos(pgm.Setpos(localPos, size, gameObject));
  132. pgm.SetFingerVisiable(true);
  133. }
  134. /// <summary>
  135. /// 点击第二个功法
  136. /// </summary>
  137. /// <param name="obj"></param>
  138. public async CTask OnStep405(UnityEngine.Object obj)
  139. {
  140. pgm.StepInit();
  141. await TimerComponent.Instance.WaitAsync(100);
  142. GameObject gameObject =
  143. UIManager.Instance.GetComponent<SkillSelectPanel>()._skillWidgets[1].own;
  144. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  145. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  146. pgm.SetfxTransVisiable(true);
  147. pgm.SetMaskTarget(gameObject);
  148. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  149. await pgm.ConfigLogic(405, delegate() { });
  150. pgm.SetFingerPos(pgm.Setpos(localPos, size, gameObject));
  151. pgm.SetFingerVisiable(true);
  152. }
  153. /// <summary>
  154. /// 对话
  155. /// </summary>
  156. /// <param name="obj"></param>
  157. public async CTask OnStep406(UnityEngine.Object obj)
  158. {
  159. pgm.StepInit();
  160. await TimerComponent.Instance.WaitAsync(100);
  161. await pgm.ConfigLogic(406, delegate() { pgm.NextGuide(); });
  162. }
  163. /// <summary>
  164. /// 这是个{火}功法,把他放在功法盘{火}的附近,会优先释放
  165. /// </summary>
  166. /// <param name="obj"></param>
  167. public async CTask OnStep407(UnityEngine.Object obj)
  168. {
  169. pgm.StepInit();
  170. await TimerComponent.Instance.WaitAsync(100);
  171. GameObject gameObject =
  172. UIManager.Instance.GetComponent<SkillSelectPanel>().allKongSkill[5].own;
  173. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  174. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  175. pgm.SetfxTransVisiable(true);
  176. pgm.SetMaskTarget(gameObject);
  177. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  178. await pgm.ConfigLogic(407, delegate() { });
  179. pgm.SetFingerPos(pgm.Setpos(localPos, size, gameObject));
  180. pgm.SetFingerVisiable(true);
  181. }
  182. /// <summary>
  183. /// 上辅助功法
  184. /// </summary>
  185. /// <param name="obj"></param>
  186. public async CTask OnStep408(UnityEngine.Object obj)
  187. {
  188. pgm.StepInit();
  189. await TimerComponent.Instance.WaitAsync(100);
  190. GameObject gameObject =
  191. UIManager.Instance.GetComponent<SkillSelectPanel>()._skillWidgets[2].own;
  192. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  193. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  194. pgm.SetfxTransVisiable(true);
  195. pgm.SetMaskTarget(gameObject);
  196. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  197. await pgm.ConfigLogic(408, delegate() { });
  198. pgm.SetFingerPos(pgm.Setpos(localPos, size, gameObject));
  199. pgm.SetFingerVisiable(true);
  200. }
  201. /// <summary>
  202. ///
  203. /// </summary>
  204. /// <param name="obj"></param>
  205. public async CTask OnStep409(UnityEngine.Object obj)
  206. {
  207. pgm.StepInit();
  208. await TimerComponent.Instance.WaitAsync(100);
  209. GameObject gameObject =
  210. UIManager.Instance.GetComponent<SkillSelectPanel>().allKongSkill[6].own;
  211. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  212. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  213. pgm.SetfxTransVisiable(true);
  214. pgm.SetMaskTarget(gameObject);
  215. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  216. await pgm.ConfigLogic(409, delegate() { });
  217. pgm.SetFingerPos(pgm.Setpos(localPos, size, gameObject));
  218. pgm.SetFingerVisiable(true);
  219. }
  220. /// <summary>
  221. /// 功法调整完毕,点这里返回
  222. /// </summary>
  223. /// <param name="obj"></param>
  224. public async CTask OnStep410(UnityEngine.Object obj)
  225. {
  226. pgm.StepInit();
  227. await TimerComponent.Instance.WaitAsync(100);
  228. GameObject gameObject =
  229. UIManager.Instance.GetComponent<SkillSelectPanel>().guanbi.gameObject;
  230. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  231. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  232. pgm.SetfxTransVisiable(true);
  233. pgm.SetMaskTarget(gameObject);
  234. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  235. await pgm.ConfigLogic(410, delegate() { });
  236. pgm.SetFingerPos(pgm.Setpos(localPos, size, gameObject));
  237. pgm.SetFingerVisiable(true);
  238. }
  239. public async CTask OnStepEnd(UnityEngine.Object obj)
  240. {
  241. pgm.StepInit();
  242. pgm.SetBlackBaseVisiable(false);
  243. ForceGuideOver();
  244. }
  245. /// <summary>
  246. /// 引导完成
  247. /// </summary>
  248. private void ForceGuideOver()
  249. {
  250. pgm.CloseForceGuide();
  251. pgm.RestGuide();
  252. }
  253. }
  254. }