|
@@ -0,0 +1,225 @@
|
|
|
|
+using Fort23.Core;
|
|
|
|
+using Fort23.UTool;
|
|
|
|
+using UnityEngine;
|
|
|
|
+using UnityEngine.UI;
|
|
|
|
+
|
|
|
|
+namespace Fort23.Mono.Phases
|
|
|
|
+{
|
|
|
|
+ public class Phase2 : IGuideLogic
|
|
|
|
+ {
|
|
|
|
+ public PlayerGuideManager pgm;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public BetterList<string> dialogList = new BetterList<string>();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private bool once = false;
|
|
|
|
+
|
|
|
|
+ public Phase2(PlayerGuideManager guideManager)
|
|
|
|
+ {
|
|
|
|
+ this.pgm = guideManager;
|
|
|
|
+ once = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public override void Active()
|
|
|
|
+ {
|
|
|
|
+ base.Active();
|
|
|
|
+ actionList.Add(OnStep201);
|
|
|
|
+ actionList.Add(OnStep202);
|
|
|
|
+ actionList.Add(OnStep203);
|
|
|
|
+ actionList.Add(OnStep204);
|
|
|
|
+ actionList.Add(OnStep205);
|
|
|
|
+ actionList.Add(OnStep206);
|
|
|
|
+ actionList.Add(OnStep207);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ actionList.Add(OnStepEnd);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public override void Begin()
|
|
|
|
+ {
|
|
|
|
+ guideID = 2;
|
|
|
|
+ guideIdx = -1;
|
|
|
|
+ pgm.isForceDone = false;
|
|
|
|
+ pgm.isTriggerDone = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public override void End()
|
|
|
|
+ {
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public override async void Guide()
|
|
|
|
+ {
|
|
|
|
+ if (actionList.Count > guideIdx)
|
|
|
|
+ {
|
|
|
|
+ pgm.ResetPlayerGuide();
|
|
|
|
+ guideIdx++;
|
|
|
|
+
|
|
|
|
+ actionList[guideIdx](null);
|
|
|
|
+ SaveStep(guideIdx);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ LogTool.Error("没有引导了,强制结束。出错步骤,:" + pgm.curPhase + guideIdx);
|
|
|
|
+ pgm.isForceDone = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public override void LogicRelase()
|
|
|
|
+ {
|
|
|
|
+ actionList.Clear();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public override void LogicUpdate()
|
|
|
|
+ {
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 点击主界面神识
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="obj"></param>
|
|
|
|
+ public async void OnStep201(UnityEngine.Object obj)
|
|
|
|
+ {
|
|
|
|
+ pgm.StepInit();
|
|
|
|
+ GameObject gameObject = UIManager.Instance.GetComponent<AppBarPanel>().bnt_shengShi.gameObject;
|
|
|
|
+ Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
|
|
|
|
+ Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
|
|
|
|
+
|
|
|
|
+ pgm.SetfxTransVisiable(true);
|
|
|
|
+ pgm.SetMaskTarget(gameObject);
|
|
|
|
+ pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
|
|
|
|
+
|
|
|
|
+ await pgm.ConfigLogic(201, delegate() { });
|
|
|
|
+
|
|
|
|
+ pgm.SetFingerPos(localPos);
|
|
|
|
+ pgm.SetFingerVisiable(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 开始探索
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="obj"></param>
|
|
|
|
+ public async void OnStep202(UnityEngine.Object obj)
|
|
|
|
+ {
|
|
|
|
+ pgm.StepInit();
|
|
|
|
+ GameObject gameObject = UIManager.Instance.GetComponent<DivineSenceInfoPanel>().Btn_Ok.gameObject;
|
|
|
|
+ Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
|
|
|
|
+ Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
|
|
|
|
+
|
|
|
|
+ pgm.SetfxTransVisiable(true);
|
|
|
|
+ pgm.SetMaskTarget(gameObject);
|
|
|
|
+ pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
|
|
|
|
+
|
|
|
|
+ await pgm.ConfigLogic(202, delegate() { });
|
|
|
|
+
|
|
|
|
+ pgm.SetFingerPos(localPos);
|
|
|
|
+ pgm.SetFingerVisiable(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public async void OnStep203(UnityEngine.Object obj)
|
|
|
|
+ {
|
|
|
|
+ pgm.StepInit();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ await pgm.ConfigLogic(203, delegate() { pgm.NextGuide(); });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public async void OnStep204(UnityEngine.Object obj)
|
|
|
|
+ {
|
|
|
|
+ pgm.StepInit();
|
|
|
|
+ await TimerComponent.Instance.WaitAsync(100);
|
|
|
|
+
|
|
|
|
+ GameObject gameObject =
|
|
|
|
+ UIManager.Instance.GetComponent<DivineSenceEventPreviewPanel>().ContentRoot.gameObject;
|
|
|
|
+ Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
|
|
|
|
+ Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
|
|
|
|
+
|
|
|
|
+ pgm.SetfxTransVisiable(true);
|
|
|
|
+ pgm.SetMaskTarget(gameObject);
|
|
|
|
+ size = new Vector2(718, 348);
|
|
|
|
+ localPos = new Vector2(0, 199);
|
|
|
|
+ pgm.SetShowFramePosAndSize(localPos, size, 0, null);
|
|
|
|
+
|
|
|
|
+ await pgm.ConfigLogic(204, delegate() { pgm.NextGuide(); });
|
|
|
|
+
|
|
|
|
+ pgm.SetFingerPos(localPos);
|
|
|
|
+ pgm.SetFingerVisiable(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public async void OnStep205(UnityEngine.Object obj)
|
|
|
|
+ {
|
|
|
|
+ pgm.StepInit();
|
|
|
|
+
|
|
|
|
+ await TimerComponent.Instance.WaitAsync(100);
|
|
|
|
+
|
|
|
|
+ GameObject gameObject = UIManager.Instance.GetComponent<DivineSenceEventPreviewPanel>()
|
|
|
|
+ .mainShengShiEventWidgetType2.own;
|
|
|
|
+ Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
|
|
|
|
+ Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
|
|
|
|
+
|
|
|
|
+ pgm.SetfxTransVisiable(true);
|
|
|
|
+ pgm.SetMaskTarget(gameObject);
|
|
|
|
+ pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
|
|
|
|
+
|
|
|
|
+ await pgm.ConfigLogic(205, delegate() { pgm.NextGuide(); });
|
|
|
|
+
|
|
|
|
+ pgm.SetFingerPos(localPos);
|
|
|
|
+ pgm.SetFingerVisiable(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public async void OnStep206(UnityEngine.Object obj)
|
|
|
|
+ {
|
|
|
|
+ pgm.StepInit();
|
|
|
|
+ GameObject gameObject = UIManager.Instance.GetComponent<DivineSenceEventPreviewPanel>()
|
|
|
|
+ .mainShengShiEventWidgetType2.Btn_Go.gameObject;
|
|
|
|
+ Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
|
|
|
|
+ Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
|
|
|
|
+
|
|
|
|
+ pgm.SetfxTransVisiable(true);
|
|
|
|
+ pgm.SetMaskTarget(gameObject);
|
|
|
|
+ pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
|
|
|
|
+
|
|
|
|
+ await pgm.ConfigLogic(206, delegate() { });
|
|
|
|
+
|
|
|
|
+ pgm.SetFingerPos(localPos);
|
|
|
|
+ pgm.SetFingerVisiable(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public async void OnStep207(UnityEngine.Object obj)
|
|
|
|
+ {
|
|
|
|
+ pgm.StepInit();
|
|
|
|
+ GameObject gameObject = UIManager.Instance.GetComponent<TaskInfoPanel>().Btn_Ok.gameObject;
|
|
|
|
+ Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position);
|
|
|
|
+ Vector2 size = gameObject.GetComponent<RectTransform>().sizeDelta;
|
|
|
|
+
|
|
|
|
+ pgm.SetfxTransVisiable(true);
|
|
|
|
+ pgm.SetMaskTarget(gameObject);
|
|
|
|
+ pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject);
|
|
|
|
+
|
|
|
|
+ await pgm.ConfigLogic(207, delegate() { });
|
|
|
|
+
|
|
|
|
+ pgm.SetFingerPos(localPos);
|
|
|
|
+ pgm.SetFingerVisiable(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public async void OnStepEnd(UnityEngine.Object obj)
|
|
|
|
+ {
|
|
|
|
+ pgm.StepInit();
|
|
|
|
+ pgm.SetBlackBaseVisiable(false);
|
|
|
|
+ ForceGuideOver();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 引导完成
|
|
|
|
+ /// </summary>
|
|
|
|
+ private void ForceGuideOver()
|
|
|
|
+ {
|
|
|
|
+ pgm.CloseForceGuide();
|
|
|
|
+ pgm.RestGuide();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|