点击物体鼠标移动转动物体

         if(Input.GetMouseButton(1))
         {//控制上下左右旋转
             obj.transform.Rotate(Vector3.up, -Time.deltaTime * 200 * Input.GetAxis("Mouse X"));
             obj.transform.Rotate(Vector3.right, Time.deltaTime * 200 * Input.GetAxis("Mouse Y"));
         }
         if (Input.GetAxis("Mouse ScrollWheel") != 0&&obj.renderer.material.color==Color.red)
         {
             scrow=Input.GetAxis("Mouse ScrollWheel");
             obj.transform.position += (transform.position - obj.transform.position).normalized * scrow;
        }

 

点击物体鼠标移动转动物体

上一篇:.net core读取appsettings.json的配置


下一篇:Prisim Sample 7 Modules App.Config