#pragma strict
var smooth=2.0;
var tiltAngle=30.0; function Start () { } function Update () {
transform.position.x=(Input.mousePosition.x-Screen.width/2)/(Screen.width/2);
transform.position.z=(Input.mousePosition.y-Screen.height/2)/(Screen.height/2);
Debug.Log(transform.position.x);
var tiltAroundZ=Input.GetAxis("Mouse X")*tiltAngle;
var tiltAroundX=Input.GetAxis("Mouse Y")*tiltAngle-2;
var target=Quaternion.Euler(tiltAroundX,0,tiltAroundZ);
transform.rotation=Quaternion.Slerp(transform.rotation,target,Time.deltaTime*smooth);
}

  

最新文章

  1. 字符串和datatime.time类型转为秒
  2. 一些很棒的js代码
  3. 使用 VS Code 来编辑 markdown 文章
  4. 【CentOS】ifconfig命令 :command not found & yum命令 :cannot find a valid baserl for repo: base/7/x86_64
  5. UWP 动画系列之模仿网易云音乐动画
  6. sql between and
  7. HandlerThread 用法
  8. BZOJ2733 [HNOI2012]永无乡
  9. WinForm数据源分页技术
  10. Hibernate逍遥游记-第7章 Hibernate的检索策略和检索方式(<set lazy="false" fetch="join">、left join fetch、FetchMode.JOIN、)
  11. [Node.js] Creating Demo APIs with json-server
  12. 用生活例子来解释Java synchronized块
  13. ARM开发板系统移植-----u-boot的编译
  14. 了解 Windows Azure 存储计费 – 带宽、事务和容量
  15. SpringWeb增删改查
  16. Redis 数据结构之dict(2)
  17. angular2-4 之动效-animation
  18. centos7 二进制安装mysql5.6
  19. [SinGuLaRiTy] 高级搜索算法
  20. python__基础 : 类的__new__方法与实现一个单例

热门文章

  1. 搭建DNS服务器
  2. MBProgressHUD使用
  3. [codeforces 260]B. Ancient Prophesy
  4. 谷歌浏览器 DEV Tools
  5. nyoj 20
  6. android文章学习 侧滑菜单实现
  7. FireFox下上传控件的显示问题
  8. 高阶函数复习:利用reduce和map把字符串转为数字
  9. java操作AJAX
  10. Ruby备忘