我正在编写一个脚本来旋转同心环,然后当它们达到 z = 0 时锁定它们。然而,我目前正在遇到一组错误,令我感到困惑。

btw a = 0f
这是受影响的代码片段 V

void Update()

{

if (transform.rotation.eulerAngles.z == a, a, a *// 错误指向这里*)

{

if (UnityEngine.Input.GetKeyDown(KeyCode.S))

ringselect = ringselect - 1;

if (UnityEngine.Input.GetKeyDown(KeyCode.W))

ringselect = ringselect + 1;

if (ringselect >= 4)

{ ringselect = 0; }

if (ringselect == ring)

{

if (Keyboard.current[Key.D].isPressed)

{ transform.Rotate(Vector3.forward * speed); }

else if (Keyboard.current[Key.A].isPressed)

{ transform.Rotate(Vector3.back * speed); }

}

}

}

https://preview.redd.it/y0djtaqgxw3h1.png?width=434&format=png&auto=webp&s=181863084bd8ab7472cd418505ccbba095424a46

这是错误截图。特别是因为之前(使用相同的代码)它会告诉我在这里加一个 } ?

任何帮助都将不胜感激。