赞
踩
方法一: 通过射线获取,缺点会获取到 射线与已抓取物体之间的物体
- public XRRayInteractor rRayInteractor;
-
- bool state = rRayInteractor.TryGetCurrent3DRaycastHit(out RaycastHit raycastHit3D);
- if (raycastHit3D.transform)
- {
- Debug.Log("transform :" + raycastHit3D.transform.name);
- }
方法二:
- List<IXRSelectInteractable> selectList = rRayInteractor.interactablesSelected;
- if (selectList != null && selectList.Count >0)
- {
- foreach (IXRSelectInteractable item in selectList)
- {
- Debug.Log("============="+item.transform.name+"=====");
-
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。