Unity3D教程:Android场景中物体的旋转平移.docxVIP

  • 14
  • 0
  • 约1.35千字
  • 约 2页
  • 2019-07-14 发布于湖北
  • 举报

Unity3D教程:Android场景中物体的旋转平移.docx

Unity3D教程:Android场景中物体的旋转平移 Posted on 2013年06月18日 by U3d / \o 查看 Unity3D 基础教程 中的全部文章 Unity3D 基础教程/被围观 37 次 实现在场景中选中任一一个物体让他旋转平移,用到Raycast类。不足之处:我本来想旋转和平移都用一个手指来表示的,但是没办法,因为旋转和平移都用到了TouchPhase.Moved,所以我最后就用Input.touchCount来区别旋转和平移了。 代码如下: 01 function Update (){ 02 var ray = Camera.main.ScreenPointToRay (Input.GetTouch(0).position); 03 var hit:RaycastHit; 04 if(Physics.Raycast(ray,hit)){ 05 if(Input.GetTouch(0).phase==TouchPhase.Moved){ 06 //一个手指控制平移 07 if(Input.touchCount==1){

文档评论(0)

1亿VIP精品文档

相关文档