public Vector2 GetHitTestLocalPoint()
{
if (this.renderMode == RenderMode.WorldSpace)
{
Camera camera = GetRenderCamera();
Vector3 screenPoint = camera.WorldToScreenPoint(this.cachedTransform.position); //only for query z value
screenPoint.x = HitTestContext.screenPoint.x;
screenPoint.y = HitTestContext.screenPoint.y;
//获得本地z轴在世界坐标的方向
HitTestContext.worldPoint = camera.ScreenToWorldPoint(screenPoint);
Ray ray = camera.ScreenPointToRay(screenPoint);
HitTestContext.direction = Vector3.zero - ray.direction;
}
return WorldToLocal(HitTestContext.worldPoint, HitTestContext.direction);
}