| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | MainInterfaceWin.IsOpenMaininterface += IsOpenMaininterface;
|
| | | _AllMissionDict = taskmodel.allMissionDict;
|
| | | _NPCID = taskmodel.NPCid;
|
| | | var npcConfig = NPCConfig.Get(_NPCID);
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | MainInterfaceWin.IsOpenMaininterface -= IsOpenMaininterface;
|
| | | }
|
| | |
|
| | | private void IsOpenMaininterface()
|
| | |
| | | {
|
| | | base.LateUpdate();
|
| | |
|
| | | if (!WindowCenter.Instance.IsOpen<DefaultDialogueBoxWin>())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | if (_hero == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (_hero.LockTarget == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | float _chkDistSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _hero.LockTarget.Pos);
|
| | | if (_chkDistSqrt > Mathf.Pow(GeneralDefine.FarawayNpcDist, 2))
|
| | | if (WindowCenter.Instance.IsOpen("MainInterfaceWin"))
|
| | | {
|
| | | WindowCenter.Instance.Close<DefaultDialogueBoxWin>();
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | |
|
| | | _hero.LockTarget = null;
|
| | | }
|
| | |
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null && hero.LockTarget != null)
|
| | | {
|
| | | var checkDistSqrt = MathUtility.DistanceSqrtXZ(hero.Pos, hero.LockTarget.Pos);
|
| | | if (checkDistSqrt > Mathf.Pow(GeneralDefine.FarawayNpcDist, 2))
|
| | | {
|
| | | WindowCenter.Instance.Close<DefaultDialogueBoxWin>();
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | hero.LockTarget = null;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|