123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- using Fort23.Core;
- using Fort23.UTool;
- using UnityEngine;
- using UnityEngine.UI;
- namespace Fort23.Mono.Phases
- {
- public class Phase3 : IGuideLogic
- {
- public PlayerGuideManager pgm;
- public BetterList<string> dialogList = new BetterList<string>();
- private bool once = false;
- public Phase3(PlayerGuideManager guideManager)
- {
- this.pgm = guideManager;
- once = true;
- }
- public override void Active()
- {
- base.Active();
- actionList.Add(OnStep301);
- actionList.Add(OnStep302);
- actionList.Add(OnStep303);
- actionList.Add(OnStepEnd);
- }
- public override void Begin()
- {
- guideID = 3;
- guideIdx = -1;
- pgm.isForceDone = false;
- pgm.isTriggerDone = false;
- }
- public override void End()
- {
- }
- public override async CTask Guide()
- {
- if (actionList.Count > guideIdx)
- {
- pgm.ResetPlayerGuide();
- guideIdx++;
- SaveStep(guideIdx);
- await actionList[guideIdx](null);
- }
- 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 CTask OnStep301(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(301, delegate() { });
- pgm.SetFingerPos(localPos);
- pgm.SetFingerVisiable(true);
- }
- /// <summary>
- /// 开始探索
- /// </summary>
- /// <param name="obj"></param>
- public async CTask OnStep302(UnityEngine.Object obj)
- {
- pgm.StepInit();
- await TimerComponent.Instance.WaitAsync(100);
- 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(302, delegate() { });
- pgm.SetFingerPos(localPos);
- pgm.SetFingerVisiable(true);
- }
- public async CTask OnStep303(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, 938);
- localPos = new Vector2(0, -96);
- pgm.SetShowFramePosAndSize(localPos, size, 0, null);
- await pgm.ConfigLogic(303, delegate() { pgm.NextGuide(); });
- pgm.SetFingerPos(localPos);
- pgm.SetFingerVisiable(true);
- }
- public async CTask OnStepEnd(UnityEngine.Object obj)
- {
- pgm.StepInit();
- pgm.SetBlackBaseVisiable(false);
- ForceGuideOver();
- }
- /// <summary>
- /// 引导完成
- /// </summary>
- private void ForceGuideOver()
- {
- pgm.CloseForceGuide();
- pgm.RestGuide();
- }
- }
- }
|