中文资源在线天堂,狠狠亚洲婷婷综合色香五月排名,亚洲熟妇丰满多毛xxxx,大陆熟妇丰满xxxxx

  • UNITY3D 腳本實(shí)現(xiàn)鼠標(biāo)控制物體旋轉(zhuǎn)

    2019/4/9??????點(diǎn)擊:

    UNITY3D 腳本實(shí)現(xiàn)鼠標(biāo)控制物體旋轉(zhuǎn),不多說(shuō),直接上代碼。 后面的文章將基于此實(shí)現(xiàn)WONGLOVE數(shù)據(jù)手套控制物體旋轉(zhuǎn),實(shí)現(xiàn)擰螺絲的效果。

    using UnityEngine;
    using System.Collections;
     
    public class BaseRotate : MonoBehaviour {
     
        public Vector3 mousePos;
     
        IEnumerator OnMouseDown()
        {
     
            mousePos = Input.mousePosition;
     
            while (Input.GetMouseButton(0))
            {
                Vector3 offset = mousePos - Input.mousePosition;
     
                transform.Rotate(Vector3.up * offset.x, Space.World);    
                transform.Rotate(Vector3.right*offset.y,Space.World);
     
                mousePos=Input.mousePosition;
                yield return null;
            }
        }
    }