This commit is contained in:
shenjianxing 2025-04-03 10:49:16 +08:00
parent 1785664947
commit f5eef93a8e
2 changed files with 49 additions and 37 deletions

View File

@ -57,14 +57,21 @@ namespace ZXK.LouDiXvMuNiu
}
private void OnDestroy()
{
var zStylus = UIRoot.Instance.vrRoot.transform.Find("ZStylus").GetComponent<ZStylus>();
zStylus.OnObjectEntered.RemoveListener(VROnEnter);
zStylus.OnObjectExited.RemoveListener(VROnExit);
zStylus.OnClick.RemoveListener(VROnClick);
var zMouse = UIRoot.Instance.vrRoot.transform.Find("ZMouse").GetComponent<ZMouse>();
zMouse.OnObjectEntered.RemoveListener(VROnEnter);
zMouse.OnObjectExited.RemoveListener(VROnExit);
zMouse.OnClick.RemoveListener(VROnClick);
try
{
var zStylus = UIRoot.Instance.vrRoot.transform.Find("ZStylus").GetComponent<ZStylus>();
zStylus.OnObjectEntered.RemoveListener(VROnEnter);
zStylus.OnObjectExited.RemoveListener(VROnExit);
zStylus.OnClick.RemoveListener(VROnClick);
var zMouse = UIRoot.Instance.vrRoot.transform.Find("ZMouse").GetComponent<ZMouse>();
zMouse.OnObjectEntered.RemoveListener(VROnEnter);
zMouse.OnObjectExited.RemoveListener(VROnExit);
zMouse.OnClick.RemoveListener(VROnClick);
}
catch (Exception)
{
}
}
#endif
private void OnMouseOver()

View File

@ -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<VideoShowPanel>().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<VideoShowPanel>().PlayVideoClip(_CurSceneStep.VideoPath, () =>
{
UI_Manage.Instance.HidePanel("ShowToastUIPrefab");
GameManager.Instance._DataNiuHandler.CurNiuHandler.Value = GameManager.Instance._DataNiuHandler.GetNextStep();
});
});
}
}
}
}