插入代码测试
2015-07-22 10:35
309 查看
public class Rotation_t: MonoBehaviour { public int speed=100; // Use this for initialization void Start () { } // Update is called once per frame void Update () { //第三个参数不加的话默认为 Space.Self if (Input.GetKey(KeyCode.A)) { transform.Rotate(Vector3.up,speed*Time.deltaTime,Space.World); } if (Input.GetKey(KeyCode.D)) { transform.Rotate(Vector3.down,speed*Time.deltaTime,Space.World); } if (Input.GetKey(KeyCode.W)) { //这里采用了rotate 函数的另外一种参数写法,两个参数,同样。第二个参数不指定的话默认为self transform.Rotate(Vector3.right*speed*Time.deltaTime,Space.World); } if (Input.GetKey(KeyCode.S)) { transform.Rotate(Vector3.left*speed*Time.deltaTime,Space.World); } } }
看这次还会不会再 乱码。。。。。
unity按WSAD 上下左右旋转脚本。
相关文章推荐
- python xmlrpclib SimpleXMLRPCServer 模块
- JAVA之BigInteger
- JAVA Calendar详解
- POJ 2253
- Java Web乱码分析及解决方案(三)——响应乱码
- C++ string 详解
- Eclipse ADT启动报“fail to load the jni shared library”问题解决方案
- Java 应用
- 【LeetCode】20 Valid Parentheses (c++实现)
- ZendFramework2学习笔记 json和ajax
- ssh批量登录并执行命令(python实现)
- 【LeetCode】205 Isomorphic Strings (c++实现)
- C++ Primer 学习笔记_63_重载运算符和转换 --转换和类类型【上】
- 如何在一台新电脑上配置JAVA开发环境
- C#验证码识别类完整实例
- Java对象的序列化和反序列化
- 关于Debug和Release的区别 (VS C#)
- c#导出Excel操作
- socket编程多客户端
- C#语言中条件与&&与条件或||的区别