Phase1.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. using Fort23.Core;
  2. using Fort23.UTool;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace Fort23.Mono.Phases
  6. {
  7. public class Phase1 : IGuideLogic
  8. {
  9. public PlayerGuideManager pgm;
  10. public BetterList<string> dialogList = new BetterList<string>();
  11. private bool once = false;
  12. public Phase1(PlayerGuideManager guideManager)
  13. {
  14. this.pgm = guideManager;
  15. once = true;
  16. }
  17. public override void Active()
  18. {
  19. base.Active();
  20. actionList.Add(OnStep101);
  21. actionList.Add(OnStep102);
  22. actionList.Add(OnStep103);
  23. actionList.Add(OnStepEnd);
  24. }
  25. public override void Begin()
  26. {
  27. guideID = 1;
  28. guideIdx = -1;
  29. pgm.isForceDone = false;
  30. pgm.isTriggerDone = false;
  31. }
  32. public override void End()
  33. {
  34. }
  35. public override async void Guide()
  36. {
  37. if (actionList.Count > guideIdx)
  38. {
  39. pgm.ResetPlayerGuide();
  40. guideIdx++;
  41. actionList[guideIdx](null);
  42. SaveStep(guideIdx);
  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 void OnStep101(UnityEngine.Object obj)
  62. {
  63. pgm.StepInit();
  64. // await pgm.ConfigLogic(101, delegate()
  65. // {
  66. //
  67. // });
  68. pgm.SetOnClickMask(true);
  69. TipMessagePanelType2 tipMessagePanelType2 = await TipMessagePanelType2.OpenTipMessagePanel(10131,isClose:false);
  70. await tipMessagePanelType2.UIClosed();
  71. if (PlayerGuideManager.Instance.GuideIsCanDo(1, 1))
  72. {
  73. PlayerGuideManager.Instance.NextGuide();
  74. }
  75. pgm.SetOnClickMask(false);
  76. }
  77. /// <summary>
  78. /// 开始探索
  79. /// </summary>
  80. /// <param name="obj"></param>
  81. public async void OnStep102(UnityEngine.Object obj)
  82. {
  83. pgm.StepInit();
  84. await pgm.ConfigLogic(102, delegate()
  85. {
  86. pgm.SetfxTransVisiable(false);
  87. pgm.NextGuide();
  88. });
  89. }
  90. public async void OnStep103(UnityEngine.Object obj)
  91. {
  92. pgm.StepInit();
  93. GameObject gameObject = UIManager.Instance.GetComponent<MainPanel>().Btn_StartEvent.gameObject;
  94. Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
  95. Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
  96. pgm.SetfxTransVisiable(true);
  97. pgm.SetMaskTarget(gameObject);
  98. pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
  99. await pgm.ConfigLogic(103, delegate() { });
  100. pgm.SetFingerPos(localPos);
  101. pgm.SetFingerVisiable(true);
  102. }
  103. public async void OnStepEnd(UnityEngine.Object obj)
  104. {
  105. pgm.StepInit();
  106. pgm.SetBlackBaseVisiable(false);
  107. ForceGuideOver();
  108. }
  109. /// <summary>
  110. /// 引导完成
  111. /// </summary>
  112. private void ForceGuideOver()
  113. {
  114. pgm.CloseForceGuide();
  115. pgm.RestGuide();
  116. }
  117. }
  118. }