在试图构建hover汽车时,如何解决这些错误?

我一直在尝试这一段时间,但是每次我尝试构建项目时,都会向我抛出这些错误:

Assets/Scripts/HoverAudio.cs(4,27): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing an assembly reference? Assets/Scripts/HoverMotor.cs(4,27): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing an assembly reference? Assets/Scripts/HoverAudio.cs(6,9): error CS0246: The type or namespace name `AudioSource' could not be found. Are you missing an assembly reference? Assets/Scripts/HoverAudio.cs(11,2): error CS0246: The type or namespace name `Vector3' could not be found. Are you missing an assembly reference? Assets/Scripts/HoverAudio.cs(12,2): error CS0246: The type or namespace name `Rigidbody' could not be found. Are you missing an assembly reference? Assets/Scripts/HoverMotor.cs(12,10): error CS0246: The type or namespace name `Rigidbody' could not be found. Are you missing an assembly reference? 

这是两个脚本:

 using UnityEngine; using System.Collections; public class HoverMotor : MonoBehaviour { public float speed = 90f; public float turnSpeed = 5f; public float hoverForce = 65f; public float hoverHeight = 3.5f; private float powerInput; private float turnInput; private Rigidbody carRigidbody; void Awake () { carRigidbody = GetComponent <Rigidbody>(); } void Update () { powerInput = Input.GetAxis ("Vertical"); turnInput = Input.GetAxis ("Horizontal"); } void FixedUpdate() { Ray ray = new Ray (transform.position, -transform.up); RaycastHit hit; if (Physics.Raycast(ray, out hit, hoverHeight)) { float proportionalHeight = (hoverHeight - hit.distance) / hoverHeight; Vector3 appliedHoverForce = Vector3.up * proportionalHeight * hoverForce; carRigidbody.AddForce(appliedHoverForce, ForceMode.Acceleration); } carRigidbody.AddRelativeForce(0f, 0f, powerInput * speed); carRigidbody.AddRelativeTorque(0f, turnInput * turnSpeed, 0f); } } 

 using UnityEngine; using System.Collections; public class HoverAudio : MonoBehaviour { public AudioSource jetSound; private float jetPitch; private const float LowPitch = .1f; private const float HighPitch = 2.0f; private const float SpeedToRevs = .01f; Vector3 myVelocity; Rigidbody carRigidbody; void Awake () { carRigidbody = GetComponent<Rigidbody>(); } private void FixedUpdate() { myVelocity = carRigidbody.velocity; float forwardSpeed = transform.InverseTransformDirection(carRigidbody.velocity).z; float engineRevs = Mathf.Abs (forwardSpeed) * SpeedToRevs; jetSound.pitch = Mathf.Clamp (engineRevs, LowPitch, HighPitch); } }