123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- using Fort23.Core;
- using Fort23.UTool;
- using UnityEngine;
- using UnityEngine.UI;
- namespace Fort23.Mono.Phases
- {
- public class Phase1 : IGuideLogic
- {
- public PlayerGuideManager pgm;
- public BetterList<string> dialogList = new BetterList<string>();
- private bool once = false;
- public Phase1(PlayerGuideManager guideManager)
- {
- this.pgm = guideManager;
- once = true;
- }
- public override void Active()
- {
- base.Active();
- actionList.Add(OnStep101);
- actionList.Add(OnStep102);
- actionList.Add(OnStep103);
-
- actionList.Add(OnStepEnd);
-
- }
- public override void Begin()
- {
- guideID = 1;
- 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 OnStep101(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);
- // pgm.SetOnClickMask(true);
-
- await pgm.ConfigLogic(101, delegate() { });
- pgm.SetFingerPos(localPos);
- pgm.SetFingerVisiable(true);
- // pgm.SetOnClickMask(false);
- }
-
- /// <summary>
- /// 开始探索
- /// </summary>
- /// <param name="obj"></param>
- public async void OnStep102(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(102, delegate() { });
-
- pgm.SetFingerPos(localPos);
- pgm.SetFingerVisiable(true);
- }
-
- /// <summary>
- /// 进入关卡按钮
- /// </summary>
- /// <param name="obj"></param>
- public async void OnStep103(UnityEngine.Object obj)
- {
- pgm.StepInit();
- await pgm.ConfigLogic(103, delegate()
- {
- pgm.SetfxTransVisiable(false);
- pgm.NextGuide();
- });
- }
- public async void OnStepEnd(UnityEngine.Object obj)
- {
- pgm.StepInit();
- pgm.SetBlackBaseVisiable(false);
- ForceGuideOver();
- }
- /// <summary>
- /// 引导完成
- /// </summary>
- private void ForceGuideOver()
- {
- pgm.CloseForceGuide();
- pgm.RestGuide();
- }
- }
- }
|