From f5eef93a8e9dc879b749d612ba3bf873e5f4ba05 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 3 Apr 2025 10:49:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8DVR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Application/SceneCtrls/AutoRotCtrl.cs | 23 ++++--- .../Application/SceneCtrls/NiuSceneMng.cs | 63 ++++++++++--------- 2 files changed, 49 insertions(+), 37 deletions(-) diff --git a/Assets/_Scripts/Application/SceneCtrls/AutoRotCtrl.cs b/Assets/_Scripts/Application/SceneCtrls/AutoRotCtrl.cs index aa429dc..31dfafb 100644 --- a/Assets/_Scripts/Application/SceneCtrls/AutoRotCtrl.cs +++ b/Assets/_Scripts/Application/SceneCtrls/AutoRotCtrl.cs @@ -57,14 +57,21 @@ namespace ZXK.LouDiXvMuNiu } private void OnDestroy() { - var zStylus = UIRoot.Instance.vrRoot.transform.Find("ZStylus").GetComponent(); - zStylus.OnObjectEntered.RemoveListener(VROnEnter); - zStylus.OnObjectExited.RemoveListener(VROnExit); - zStylus.OnClick.RemoveListener(VROnClick); - var zMouse = UIRoot.Instance.vrRoot.transform.Find("ZMouse").GetComponent(); - zMouse.OnObjectEntered.RemoveListener(VROnEnter); - zMouse.OnObjectExited.RemoveListener(VROnExit); - zMouse.OnClick.RemoveListener(VROnClick); + try + { + var zStylus = UIRoot.Instance.vrRoot.transform.Find("ZStylus").GetComponent(); + zStylus.OnObjectEntered.RemoveListener(VROnEnter); + zStylus.OnObjectExited.RemoveListener(VROnExit); + zStylus.OnClick.RemoveListener(VROnClick); + var zMouse = UIRoot.Instance.vrRoot.transform.Find("ZMouse").GetComponent(); + zMouse.OnObjectEntered.RemoveListener(VROnEnter); + zMouse.OnObjectExited.RemoveListener(VROnExit); + zMouse.OnClick.RemoveListener(VROnClick); + } + catch (Exception) + { + } + } #endif private void OnMouseOver() diff --git a/Assets/_Scripts/Application/SceneCtrls/NiuSceneMng.cs b/Assets/_Scripts/Application/SceneCtrls/NiuSceneMng.cs index 7000c79..101bac6 100644 --- a/Assets/_Scripts/Application/SceneCtrls/NiuSceneMng.cs +++ b/Assets/_Scripts/Application/SceneCtrls/NiuSceneMng.cs @@ -111,43 +111,48 @@ namespace ZXK.LouDiXvMuNiu private void VROnClick(ZPointer arg0, int arg1, GameObject arg2) { - NiuData curdata = GameManager.Instance._DataNiuHandler.CurNiuHandler.Value; - if (_CurSceneStep.TaskType.Equals(ConstCtrl.TASKTYPE_Anim)) - {//timeline - if (enterObj != null && !_IsPlayAnm) - { - if (!string.IsNullOrEmpty(curdata.CameraNearTR2) && _isNearCameraTR) - { - CameraSetNear2TR(curdata); - } - ClickToolCallInTrainState(enterObj, () => - { - UI_Manage.Instance.HidePanel("ShowToastUIPrefab"); - JumpTimeline(GameManager.Instance._DataNiuHandler.GetNextStep(), false); - }); - ClickToolCallInExamState(enterObj, () => - { - UI_Manage.Instance.HidePanel("ShowToastUIPrefab"); - JumpTimeline(GameManager.Instance._DataNiuHandler.GetNextStep(_CurSceneStep.QNextNum), false); - }); - } - } - else if (_CurSceneStep.TaskType.Equals(ConstCtrl.TASKTYPE_Video)) + + if (arg2.layer != LayerMask.NameToLayer("UI")) { - if (enterObj != null) - { - ClickToolCallInTrainState(enterObj, () => + NiuData curdata = GameManager.Instance._DataNiuHandler.CurNiuHandler.Value; + if (_CurSceneStep.TaskType.Equals(ConstCtrl.TASKTYPE_Anim)) + {//timeline + if (enterObj != null && !_IsPlayAnm) { - GameObject videoGeo = UI_Manage.Instance.ShowPanel("VideoShowPanel", Type.GetType("ZXK.LouDiXvMuNiu.VideoShowPanel"), CG.Framework.UIGroup.Tip); - videoGeo.GetComponent().PlayVideoClip(_CurSceneStep.VideoPath, () => + if (!string.IsNullOrEmpty(curdata.CameraNearTR2) && _isNearCameraTR) + { + CameraSetNear2TR(curdata); + } + ClickToolCallInTrainState(enterObj, () => { UI_Manage.Instance.HidePanel("ShowToastUIPrefab"); - GameManager.Instance._DataNiuHandler.CurNiuHandler.Value = GameManager.Instance._DataNiuHandler.GetNextStep(); + JumpTimeline(GameManager.Instance._DataNiuHandler.GetNextStep(), false); }); - }); + ClickToolCallInExamState(enterObj, () => + { + UI_Manage.Instance.HidePanel("ShowToastUIPrefab"); + JumpTimeline(GameManager.Instance._DataNiuHandler.GetNextStep(_CurSceneStep.QNextNum), false); + }); + } } + else if (_CurSceneStep.TaskType.Equals(ConstCtrl.TASKTYPE_Video)) + { + if (enterObj != null) + { + ClickToolCallInTrainState(enterObj, () => + { + GameObject videoGeo = UI_Manage.Instance.ShowPanel("VideoShowPanel", Type.GetType("ZXK.LouDiXvMuNiu.VideoShowPanel"), CG.Framework.UIGroup.Tip); + videoGeo.GetComponent().PlayVideoClip(_CurSceneStep.VideoPath, () => + { + UI_Manage.Instance.HidePanel("ShowToastUIPrefab"); + GameManager.Instance._DataNiuHandler.CurNiuHandler.Value = GameManager.Instance._DataNiuHandler.GetNextStep(); + }); + }); + } + } } + }