using Fort23.Core; using Fort23.UTool; using UnityEngine; using UnityEngine.UI; namespace Fort23.Mono.Phases { public class Phase2 : IGuideLogic { public PlayerGuideManager pgm; public BetterList dialogList = new BetterList(); 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 CTask 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() { } /// /// 点击主界面神识 /// /// public async CTask OnStep201(UnityEngine.Object obj) { pgm.StepInit(); GameObject gameObject = UIManager.Instance.GetComponent().bnt_shengShi.gameObject; Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position); Vector2 size = gameObject.GetComponent().sizeDelta; pgm.SetfxTransVisiable(true); pgm.SetMaskTarget(gameObject); pgm.SetShowFramePosAndSize(localPos, size, 0, gameObject); await pgm.ConfigLogic(201, delegate() { }); pgm.SetFingerPos(localPos); pgm.SetFingerVisiable(true); } /// /// 开始探索 /// /// public async CTask OnStep202(UnityEngine.Object obj) { pgm.StepInit(); GameObject gameObject = UIManager.Instance.GetComponent().Btn_Ok.gameObject; Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position); Vector2 size = gameObject.GetComponent().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 CTask OnStep203(UnityEngine.Object obj) { pgm.StepInit(); await pgm.ConfigLogic(203, delegate() { pgm.NextGuide(); }); } public async CTask OnStep204(UnityEngine.Object obj) { pgm.StepInit(); await TimerComponent.Instance.WaitAsync(100); GameObject gameObject = UIManager.Instance.GetComponent().ContentRoot.gameObject; Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position); Vector2 size = gameObject.GetComponent().sizeDelta; pgm.SetfxTransVisiable(true); // pgm.SetMaskTarget(gameObject); size = new Vector2(718, 938); localPos = new Vector2(0, -96); pgm.SetShowFramePosAndSize(localPos, size, 0, null); await pgm.ConfigLogic(204, delegate() { pgm.NextGuide(); }); pgm.SetFingerPos(localPos); pgm.SetFingerVisiable(true); } public async CTask OnStep205(UnityEngine.Object obj) { pgm.StepInit(); await TimerComponent.Instance.WaitAsync(100); GameObject gameObject = UIManager.Instance.GetComponent() .mainShengShiEventWidgetType2.own; Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position); Vector2 size = gameObject.GetComponent().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 CTask OnStep206(UnityEngine.Object obj) { pgm.StepInit(); GameObject gameObject = UIManager.Instance.GetComponent() .mainShengShiEventWidgetType2.Btn_Go.gameObject; Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position); Vector2 size = gameObject.GetComponent().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 CTask OnStep207(UnityEngine.Object obj) { pgm.StepInit(); GameObject gameObject = UIManager.Instance.GetComponent().Btn_Ok.gameObject; Vector3 localPos = pgm.WorldPosToLocalPos(gameObject.transform.position); Vector2 size = gameObject.GetComponent().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 CTask OnStepEnd(UnityEngine.Object obj) { pgm.StepInit(); pgm.SetBlackBaseVisiable(false); ForceGuideOver(); } /// /// 引导完成 /// private void ForceGuideOver() { pgm.CloseForceGuide(); pgm.RestGuide(); } } }