this.transform.Translate(Vector3.right * Input.GetAxisRaw("Horizontal") * speed * Time.deltaTime);
this.transform.Translate(Vector3.forward * Input.GetAxisRaw("Vertical") * speed * Time.deltaTime);
// Debug.LogWarning("FIRE"+ Input.GetAxisRaw("Mouse Y")+","+ Input.GetAxisRaw("Vertical"));
if (Input.GetKey(KeyCode.Q))
{
this.transform.Translate(Vector3.up * speed * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.E))
{
this.transform.Translate(Vector3.down * speed * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.Z))
{
this.transform.Rotate(Vector3.up *1 * rotateSpeed * Time.deltaTime);//围绕y轴,旋转
}
else if (Input.GetKey(KeyCode.X))
{
this.transform.Rotate(Vector3.up * -1 * rotateSpeed * Time.deltaTime);//围绕y轴,旋转
}
else if (Input.GetKey(KeyCode.C))
{
this.transform.Rotate(Vector3.right * 1 * rotateSpeed * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.V))
{
this.transform.Rotate(Vector3.right * -1 * rotateSpeed * Time.deltaTime);
}
网友评论