美文网首页UNITY
Unity UI跟随

Unity UI跟随

作者: Lennie_S | 来源:发表于2019-10-08 19:08 被阅读0次

//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();

相关文章

网友评论

    本文标题:Unity UI跟随

    本文链接:https://www.haomeiwen.com/subject/pnvnjctx.html