UNITY

Unity UI跟随

2019-10-08  本文已影响0人  Lennie_S

//1.屏幕转世界坐标 Vector3 Camera.main.ScreenToWorldPoint(new Vector3(screenPos.x , screenPos.y , zInfo)); 

//2.世界转屏幕坐标 Vector3 Camera.main.WorldToScreenPoint(new Vector3(worldPos.x , worldPos.y , worldPos.z)); 

//3.世界转视口坐标 Vector3 Camera.main.WorldToViewportPoint(); 

//4.视口转世界坐标 Vector3 Camera.main.ViewportToWorldPoint(new Vector3(viewPortPos.x , viewPortPos.y , zInfo)); 

//5.视口转屏幕坐标 Vector3 Camera.main.ViewportToScreenPoint(); 

//6.屏幕转视口坐标 Vector3 Camera.main.ScreenToViewportPoint();

上一篇 下一篇

猜你喜欢

热点阅读