Unity transform
up 是 Y 轴
right 是 X 轴
Translate 移动
向左移动:
transform.Translate (Vector3.right * Time.deltaTime);
向右移动:
transform.Translate (Vector3.right * Time.deltaTime * -1);
向后移动:
transform.Translate (Vector3.forward * Time.deltaTime);
向前移动:
transform.Translate (Vector3.forward * Time.deltaTime * -1);
向上移动:
transform.Translate (Vector3.up * Time.deltaTime);
向下移动:
transform.Translate (Vector3.up * Time.deltaTime * -1);
Rotate 旋转
向右旋转:
transform.Rotate (Vector3.up * Time.deltaTime * 100);
向左旋转:
transform.Rotate (Vector3.up * Time.deltaTime * -100);
向上(向后)旋转:
transform.Rotate (Vector3.right * Time.deltaTime * 100);
向下(向前)旋转:
transform.Rotate (Vector3.right * Time.deltaTime * -100);
逆时针(向右)旋转:
transform.Rotate (Vector3.forward * Time.deltaTime * 100);
顺时针(向左)旋转:
transform.Rotate (Vector3.forward * Time.deltaTime * -100);