Phase5.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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(OnStep502);
  24. actionList.Add(OnStepEnd);
  25. }
  26. public override void Begin()
  27. {
  28. guideID = 5;
  29. guideIdx = -1;
  30. pgm.isForceDone = false;
  31. pgm.isTriggerDone = false;
  32. }
  33. public override void End()
  34. {
  35. }
  36. public override async CTask Guide()
  37. {
  38. if (actionList.Count > guideIdx)
  39. {
  40. pgm.ResetPlayerGuide();
  41. guideIdx++;
  42. SaveStep(guideIdx);
  43. await actionList[guideIdx](null);
  44. }
  45. else
  46. {
  47. LogTool.Error("没有引导了,强制结束。出错步骤,:" + pgm.curPhase + guideIdx);
  48. pgm.isForceDone = true;
  49. }
  50. }
  51. public override void LogicRelase()
  52. {
  53. actionList.Clear();
  54. }
  55. public override void LogicUpdate()
  56. {
  57. }
  58. /// <summary>
  59. /// 点击功法
  60. /// </summary>
  61. /// <param name="obj"></param>
  62. public async CTask OnStep501(UnityEngine.Object obj)
  63. {
  64. pgm.StepInit();
  65. pgm.SetBlackAlpha(0.05f);
  66. pgm.SetOnClickMask(true);
  67. // CombatPanel combatPanel = UIManager.Instance.GetComponent<CombatPanel>();
  68. // combatPanel.CameraSelect.value = 0.2f;
  69. await TimerComponent.Instance.WaitAsync(1000);
  70. pgm.SetOnClickMask(false);
  71. CombatDrive.Instance.CombatController.isUpdate = false;
  72. await pgm.ConfigLogic(501, delegate() { pgm.NextGuide(); });
  73. }
  74. /// <summary>
  75. /// 点击功法
  76. /// </summary>
  77. /// <param name="obj"></param>
  78. public async CTask OnStep502(UnityEngine.Object obj)
  79. {
  80. pgm.StepInit();
  81. CombatDrive.Instance.CombatController.isUpdate = true;
  82. await pgm.ConfigLogic(502, delegate() { });
  83. }
  84. public async CTask OnStepEnd(UnityEngine.Object obj)
  85. {
  86. pgm.StepInit();
  87. CombatDrive.Instance.CombatController.isUpdate = true;
  88. pgm.SetBlackBaseVisiable(false);
  89. ForceGuideOver();
  90. }
  91. /// <summary>
  92. /// 引导完成
  93. /// </summary>
  94. private void ForceGuideOver()
  95. {
  96. pgm.CloseForceGuide();
  97. pgm.RestGuide();
  98. }
  99. }
  100. }