关于坐标转换
//世界坐标到NGUI屏幕坐标转换
public static Vector3 WordPostionToNGUIPostion(Vector3 position)
{
//得到屏幕所在的位置
Vector3 pt = Camera.main.WorldToScreenPoint(position);
Vector3 ff = Vector3.zero;
if (UICamera.currentCamera == null)
{
ff = UICamera.mainCamera.ScreenToWorldPoint(pt);
}
else
{
ff = UICamera.currentCamera.ScreenToWorldPoint(pt);
}
return ff;
}
本文详细介绍了如何将世界坐标转换为NGUI屏幕坐标,并提供了实现代码,帮助开发者解决游戏开发中坐标转换的问题。

4142

被折叠的 条评论
为什么被折叠?



