在Canvas是Overlay的情况下,直接用UITransform.position得到的其实就是屏幕坐标,不用再转了
另外,想要让这些坐标跟UI元素的坐标扯上关系,还要用到ScreenPointToWorldPointInRectangle,否则出来的坐标用到UI的position上是不对的。
Unity的坐标系统真麻烦啊。
更多关于坐标转换的知识:https://blog.csdn.net/Cc_Super/article/details/126977200
https://blog.csdn.net/qq_62947569/article/details/128441051