Phase6.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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 Phase6 : IGuideLogic
  10. {
  11. public PlayerGuideManager pgm;
  12. private bool once = false;
  13. public Phase6(PlayerGuideManager guideManager)
  14. {
  15. this.pgm = guideManager;
  16. once = true;
  17. }
  18. public override void Active()
  19. {
  20. base.Active();
  21. actionList.Add(OnStep601);
  22. actionList.Add(OnStep602);
  23. actionList.Add(OnStep603);
  24. actionList.Add(OnStepEnd);
  25. }
  26. public override void Begin()
  27. {
  28. guideID = 6;
  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 OnStep601(UnityEngine.Object obj)
  63. {
  64. GameObject gameObject = UIManager.Instance.GetComponent<AppBarPanel>().Btn_DongFu.gameObject;
  65. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  66. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  67. pgm.SetfxTransVisiable(true);
  68. pgm.SetMaskTarget(gameObject);
  69. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  70. await pgm.ConfigLogic(601, delegate() { });
  71. pgm.SetFingerPos(localPos);
  72. pgm.SetFingerVisiable(true);
  73. }
  74. /// <summary>
  75. /// 点击修炼
  76. /// </summary>
  77. /// <param name="obj"></param>
  78. public async CTask OnStep602(UnityEngine.Object obj)
  79. {
  80. GameObject gameObject = UIManager.Instance.GetComponent<CaveMainPanel>().Btn_XiuLian.gameObject;
  81. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  82. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  83. pgm.SetfxTransVisiable(true);
  84. pgm.SetMaskTarget(gameObject);
  85. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  86. await pgm.ConfigLogic(602, delegate() { });
  87. pgm.SetFingerPos(localPos);
  88. pgm.SetFingerVisiable(true);
  89. }
  90. /// <summary>
  91. /// 升级
  92. /// </summary>
  93. /// <param name="obj"></param>
  94. public async CTask OnStep603(UnityEngine.Object obj)
  95. {
  96. GameObject gameObject = UIManager.Instance.GetComponent<HeroInformationPanel>().Btn_TuPo.gameObject;
  97. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  98. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  99. pgm.SetfxTransVisiable(true);
  100. pgm.SetMaskTarget(gameObject);
  101. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  102. await pgm.ConfigLogic(603, delegate() { });
  103. pgm.SetFingerPos(localPos);
  104. pgm.SetFingerVisiable(true);
  105. }
  106. public async CTask OnStepEnd(UnityEngine.Object obj)
  107. {
  108. pgm.StepInit();
  109. pgm.SetBlackBaseVisiable(false);
  110. ForceGuideOver();
  111. }
  112. /// <summary>
  113. /// 引导完成
  114. /// </summary>
  115. private void ForceGuideOver()
  116. {
  117. pgm.CloseForceGuide();
  118. pgm.RestGuide();
  119. }
  120. }
  121. }