Phase5.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using Fort23.Core;
  2. using Fort23.UTool;
  3. using GameLogic.Combat;
  4. using GameLogic.Combat.CombatTool;
  5. using UnityEngine;
  6. using UnityEngine.UI;
  7. namespace Fort23.Mono.Phases
  8. {
  9. public class Phase5 : IGuideLogic
  10. {
  11. public PlayerGuideManager pgm;
  12. public BetterList<string> dialogList = new BetterList<string>();
  13. private bool once = false;
  14. public Phase5(PlayerGuideManager guideManager)
  15. {
  16. this.pgm = guideManager;
  17. once = true;
  18. }
  19. public override void Active()
  20. {
  21. base.Active();
  22. actionList.Add(OnStep501);
  23. actionList.Add(OnStepEnd);
  24. }
  25. public override void Begin()
  26. {
  27. guideID = 5;
  28. guideIdx = -1;
  29. pgm.isForceDone = false;
  30. pgm.isTriggerDone = false;
  31. }
  32. public override void End()
  33. {
  34. }
  35. public override async CTask Guide()
  36. {
  37. if (actionList.Count > guideIdx)
  38. {
  39. pgm.ResetPlayerGuide();
  40. guideIdx++;
  41. SaveStep(guideIdx);
  42. await actionList[guideIdx](null);
  43. }
  44. else
  45. {
  46. LogTool.Error("没有引导了,强制结束。出错步骤,:" + pgm.curPhase + guideIdx);
  47. pgm.isForceDone = true;
  48. }
  49. }
  50. public override void LogicRelase()
  51. {
  52. actionList.Clear();
  53. }
  54. public override void LogicUpdate()
  55. {
  56. }
  57. /// <summary>
  58. /// 点击功法
  59. /// </summary>
  60. /// <param name="obj"></param>
  61. public async CTask OnStep501(UnityEngine.Object obj)
  62. {
  63. pgm.StepInit();
  64. pgm.SetBlackAlpha(0.05f);
  65. pgm.SetOnClickMask(true);
  66. await TimerComponent.Instance.WaitAsync(1000);
  67. pgm.SetOnClickMask(false);
  68. CombatDrive.Instance.CombatController.ChangeState(CombatController.idle);
  69. await pgm.ConfigLogic(501, delegate() { pgm.NextGuide(); });
  70. }
  71. public async CTask OnStepEnd(UnityEngine.Object obj)
  72. {
  73. pgm.StepInit();
  74. CombatDrive.Instance.CombatController.ChangeState(CombatController.update);
  75. pgm.SetBlackBaseVisiable(false);
  76. ForceGuideOver();
  77. }
  78. /// <summary>
  79. /// 引导完成
  80. /// </summary>
  81. private void ForceGuideOver()
  82. {
  83. pgm.CloseForceGuide();
  84. pgm.RestGuide();
  85. }
  86. }
  87. }