ユニティ・インターフェースは、座標位置によってワールド座標系に変換します

パブリック 静的ベクトル2 WorldToCanvasPoint(キャンバスキャンバス、のVector3 worldPos)
    { 
        ベクトル2のPOS。
        RectTransformUtility.ScreenPointToLocalPointInRectangle(canvas.transform としてRectTransform、
            Camera.main.WorldToScreenPoint(worldPos)、canvas.worldCamera、アウトPOS)。
        返すPOSを。
    }

 

おすすめ

転載: www.cnblogs.com/ylwn817/p/10937632.html