插入代码测试

来源:互联网 发布:优化 服务 编辑:程序博客网 时间:2024/06/10 16:26
public class Rotation_t: MonoBehaviour {public int speed=100;// Use this for initializationvoid Start () {}// Update is called once per framevoid Update () {//第三个参数不加的话默认为 Space.Selfif (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 函数的另外一种参数写法,两个参数,同样。第二个参数不指定的话默认为selftransform.Rotate(Vector3.right*speed*Time.deltaTime,Space.World);}if (Input.GetKey(KeyCode.S)) {transform.Rotate(Vector3.left*speed*Time.deltaTime,Space.World);}}}

看这次还会不会再 乱码。。。。。

unity按WSAD 上下左右旋转脚本。


0 0
原创粉丝点击