<em id="0a85b"><option id="0a85b"></option></em>

<abbr id="0a85b"></abbr>

      <nobr id="0a85b"></nobr>
        <tr id="0a85b"></tr>
        9久久伊人精品综合,亚洲一区精品视频在线,成 人免费va视频,国产一区二区三区黄网,99国产精品永久免费视频,亚洲毛片多多影院,精品久久久无码人妻中文字幕,无码国产欧美一区二区三区不卡
        學習啦>學習電腦>電腦硬件知識>鍵盤鼠標>

        Unity3d鼠標拖拽物體

        時間: 沈迪豪908 分享

          愛學習的小伙伴們,可能都有了解過Unity3d ,但是你知道Unity3d 怎么使用鼠標拖拽物體嗎?

          Unity3d使用鼠標拖拽物體的具體代碼

          //Drag object using mouse

          //editor by faye euler

          //add script components to the collider Object with need to be draging

          //將代碼附加到要被拖拽的collider物體上

          function Update () {

          }

          var screenSpace;

          var offset;

          function OnMouseDown(){

          //translate the cubes position from the world to Screen Point

          //轉換對象位置,從世界點到屏幕座標

          screenSpace = Camera.main.WorldToScreenPoint(transform.position);

          //calculate any difference between the cubes world position and the mouses Screen position converted to a worldpoint

          //在對象世界座標與鼠標屏幕座標計算任何不同,轉換到世界點上

          offset = transform.position - Camera.main.ScreenToWorldPoint(Vector3(Input.mousePosition.x,Input.mousePosition.y, screenSpace.z));

          }

          /*

          OnMouseDrag is called when the user has clicked on a GUIElement or Collider and is still holding down the mouse.

          OnMouseDrag is called every frame while the mouse is down.

          */

          function OnMouseDrag () {

          //keep track of the mouse position

          //保持鼠標位置追蹤

          var curScreenSpace = Vector3(Input.mousePosition.x, Input.mousePosition.y, screenSpace.z);

          //convert the screen mouse position to world point and adjust with offset

          //轉換屏幕鼠標位置到世界點,以及通過偏移調整

          var curPosition = Camera.main.ScreenToWorldPoint(curScreenSpace) + offset;

          //update the position of the object in the world

          //更新物體在世界的位置

          transform.position = curPosition;

          }

        猜你喜歡:

        1.2016程序員跳槽全攻略

        2.2016有什么好玩的手機游戲

        3.創業,我們的故事

        4.如何從零開始創業

        5.90后創業心得

        1997108 主站蜘蛛池模板: 手机在线观看av片| 国产乱子伦视频在线播放| 亚洲天堂领先自拍视频网| 精品麻豆国产色欲色欲色欲WWW| 乱公和我做爽死我视频| av小次郎网站| 国产精品hd免费观看| 亚洲熟妇乱色一区二区三区| 1精品啪国产在线观看免费牛牛| 国产一级小视频| 亚洲 制服 丝袜 无码| 婷婷丁香五月亚洲中文字幕| 中年国产丰满熟女乱子正在播放| 少妇无码AV无码专区| 国产美女裸体无遮挡免费视频下载 | 老鸭窝在钱视频| 免费区欧美一级猛片| 亚洲 欧洲 无码 在线观看 | 国产乱人无码伦av在线a| 欧美福利电影A在线播放| 中文字幕丰满乱子无码视频| 精品一区二区亚洲国产| 亚洲人成小说网站色在线| 午夜精品一区二区三区成人| 欧洲美熟女乱又伦免费视频| 亚洲一区二区三区蜜桃臀| 色伦专区97中文字幕| 中文字幕乱妇无码AV在线| 国产黄色免费看| 欧美牲交a欧美牲交aⅴ免费真| 中文丰满岳乱妇在线观看| 在线日韩日本国产亚洲| 久久久久无码精品国产AV| 99久久婷婷国产综合精品青草漫画 | 国产精品无码久久久久AV| 国产成人精品国内自产色| 日本区二区三区不卡视频| 国产成人一区二区三区免费| 亚洲精品揄拍自拍首页一| 日本免费一区二区三区高清视频| 麻豆亚洲自偷拍精品日韩另|