void OnRay(Ray ray, Ray uiRay, int handIndex) { if (handIndex != InputHand.HandIndex) { return; } RaycastHit hit; //限制处理 if (RayExternaLimit != null && RayExternaLimit()) { OnNoRayTarget(); } //执行UI操作 else if (UIOperate.OnUIRay(uiRay)) { OnNoRayTarget(); } //物体处理 else if (Physics.Raycast(ray, out hit, 10000, 1 << MOperateManager.layerRay | 1 << MOperateManager.layerObject)) { OnRayTarget(hit); } else { OnNoRayTarget(); } }
void OnRay(Ray ray, Ray uiRay, int handIndex) { if (handIndex != InputHand.HandIndex) { return; } if (InputHand.IsErrorStatus || InputHand.IsRotateZoomStatus) { return; } RaycastHit hit; //限制处理 if (RayExternaLimit != null && RayExternaLimit()) { OnNoRayTarget(); } //执行UI操作 else if (UIOperate.OnUIRay(uiRay)) { OnNoRayTarget(); } //物体处理 else if (MSwitchManager.CurrentMode == OperateModeType.Move && Physics.Raycast(ray, out hit, 10000, 1 << MOperateManager.layerRay | 1 << MOperateManager.layerObject)) { OnRayTarget(hit, ray); } else { OnNoRayTarget(); } }