关于坐标转换
//世界坐标到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;
}