|  | @@ -0,0 +1,133 @@
 | 
											
												
													
														|  | 
 |  | +using Fort23.Core;
 | 
											
												
													
														|  | 
 |  | +using Fort23.UTool;
 | 
											
												
													
														|  | 
 |  | +using GameLogic.Combat;
 | 
											
												
													
														|  | 
 |  | +using GameLogic.Combat.CombatTool;
 | 
											
												
													
														|  | 
 |  | +using UnityEngine;
 | 
											
												
													
														|  | 
 |  | +using UnityEngine.UI;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +namespace Fort23.Mono.Phases
 | 
											
												
													
														|  | 
 |  | +{
 | 
											
												
													
														|  | 
 |  | +    public class Phase9 : IGuideLogic
 | 
											
												
													
														|  | 
 |  | +    {
 | 
											
												
													
														|  | 
 |  | +        public PlayerGuideManager pgm;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        private bool once = false;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        public Phase9(PlayerGuideManager guideManager)
 | 
											
												
													
														|  | 
 |  | +        {
 | 
											
												
													
														|  | 
 |  | +            this.pgm = guideManager;
 | 
											
												
													
														|  | 
 |  | +            once = true;
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        public override void Active()
 | 
											
												
													
														|  | 
 |  | +        {
 | 
											
												
													
														|  | 
 |  | +            base.Active();
 | 
											
												
													
														|  | 
 |  | +            actionList.Add(OnStep901);
 | 
											
												
													
														|  | 
 |  | +            actionList.Add(OnStep902);
 | 
											
												
													
														|  | 
 |  | +            actionList.Add(OnStepEnd);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        public override void Begin()
 | 
											
												
													
														|  | 
 |  | +        {
 | 
											
												
													
														|  | 
 |  | +            guideID =9;
 | 
											
												
													
														|  | 
 |  | +            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 OnStep901(UnityEngine.Object obj)
 | 
											
												
													
														|  | 
 |  | +        {
 | 
											
												
													
														|  | 
 |  | +            pgm.StepInit();
 | 
											
												
													
														|  | 
 |  | +            await TimerComponent.Instance.WaitAsync(100);
 | 
											
												
													
														|  | 
 |  | +            GameObject gameObject = UIManager.Instance.GetComponent<MainPanel>().Btn_Box.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(901, delegate() { });
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            pgm.SetFingerPos(localPos);
 | 
											
												
													
														|  | 
 |  | +            pgm.SetFingerVisiable(true);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        /// <summary>
 | 
											
												
													
														|  | 
 |  | +        /// 点十连抽
 | 
											
												
													
														|  | 
 |  | +        /// </summary>
 | 
											
												
													
														|  | 
 |  | +        /// <param name="obj"></param>
 | 
											
												
													
														|  | 
 |  | +        public async CTask OnStep902(UnityEngine.Object obj)
 | 
											
												
													
														|  | 
 |  | +        {
 | 
											
												
													
														|  | 
 |  | +            pgm.StepInit();
 | 
											
												
													
														|  | 
 |  | +            await TimerComponent.Instance.WaitAsync(100);
 | 
											
												
													
														|  | 
 |  | +            GameObject gameObject = UIManager.Instance.GetComponent<BoxPanel>().oneButton.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(902, delegate() { });
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            pgm.SetFingerPos(localPos);
 | 
											
												
													
														|  | 
 |  | +            pgm.SetFingerVisiable(true);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        public async CTask OnStepEnd(UnityEngine.Object obj)
 | 
											
												
													
														|  | 
 |  | +        {
 | 
											
												
													
														|  | 
 |  | +            pgm.StepInit();
 | 
											
												
													
														|  | 
 |  | +            pgm.SetBlackBaseVisiable(false);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            ForceGuideOver();
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        /// <summary>
 | 
											
												
													
														|  | 
 |  | +        /// 引导完成
 | 
											
												
													
														|  | 
 |  | +        /// </summary>
 | 
											
												
													
														|  | 
 |  | +        private async void ForceGuideOver()
 | 
											
												
													
														|  | 
 |  | +        {
 | 
											
												
													
														|  | 
 |  | +            pgm.CloseForceGuide();
 | 
											
												
													
														|  | 
 |  | +            pgm.RestGuide();
 | 
											
												
													
														|  | 
 |  | +            await UIManager.Instance.HideUIUIPanel<GachaPanel>();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            UIManager.Instance.HideUIUIPanel<BoxPanel>();
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +}
 |