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