Point coordinates in world space are converted to screen coordinates:
Screenpos = Recttransformutility.worldtoscreenpoint (Cam, worldPos.transform.position);
The coordinates of the Ugui object are converted to screen coordinates:
Screenpos = Recttransformutility.worldtoscreenpoint (Canvas.worldcamera, uguiObj.transform.position);
Screen coordinates are converted to Ugui coordinates:
Vector3 Worldpoint;
if (Recttransformutility.screenpointtoworldpointinrectangle (Recttrans, CamPos, Canvas.worldcamera,out worldPoint))
{
Transform.position = Worldpoint;
}
Screen coordinates are converted to world space coordinates (Ray collision position):
var ray = Recttransformutility.screenpointtoray (Worldcamera, Screenpos);
Raycasthit Hitinfo;
if (Physics.raycast (ray, out Hitinfo))
{
Pos.transform.position = Hitinfo.point;
}
Unity ugui Ray Coordinate conversion summary