NGUI版本:2021.11.30
修改UICamera.cs:
在ProcessEvents()方法中修改,不调用ProcessTouches()和ProcessMouse(),新建一个方法ProcessRay()。
static MouseOrTouch mRay = new MouseOrTouch();
public void ProcessRay()
{
currentTouch = mRay;
currentTouch.pos = Vector2.zero;
Raycast(currentTouch);
hoveredObject = currentTouch.current;
if (点击事件)
Notify(hoveredObject, "OnClick", null);
}
Raycast(vector3)方法中,var ray = currentCamera.ScreenPointToRay(inPos);根据条件判断,改为其他射线。