close
[Canvas its RenderMode is set to ScreenSpaceOverlay]
transform.position = Input.mousePosition;
[Canvas its RenderMode is set to Other]
Vector2 pos;
RectTransformUtility.ScreenPointToLocalPointInRectangle(myCanvas.transform as RectTransform, Input.mousePosition, myCanvas.worldCamera, out pos);
transform.position = myCanvas.transform.TransformPoint(pos);
全站熱搜
留言列表