📜  如何更改 Vector3 变量的轴 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:06.893000             🧑  作者: Mango

代码示例1
Vector3 playerPosition = new Vector3(0, 0, 0); 

void Update()
{
    Input.Getkey("w")
    {
        playerPosition = transform.position;
        playerPosition.x -= 1f;
        transform.position = playerPosition;
    }
}