第二章单元测试
  1. using UnityEngine;

     

    public class RotateCube : MonoBehaviour

    {

        public float rotationSpeed = 50f;

     

        // Update is called once per frame

        void Update()

        {

            // 每帧绕着世界坐标系的上方向(Vector3.up)旋转

            transform.Rotate(Vector3.up, rotationSpeed * Time.deltaTime);

        }

    }

    上面代码关于 Unity3D 中的立方体旋转脚本的描述哪些是正确的(   )



  2. A:旋转速度是固定的,不受帧率的影响。 B:在脚本中使用了 Vector3.up 来定义旋转的轴。 C:该脚本使用 FixedUpdate 方法来执行旋转逻辑。 D:该脚本使用 Start 方法来执行旋转逻辑。
    答案:在脚本中使用了 Vector3.up 来定义旋转的轴。

点赞(1) dxwkbang
返回
顶部