NullReferenceException: Object reference not set to an instance of an object
Wall.OnCollisionEnter2D () (at Assets/Scripts/Wall.cs:13)
代码:
public class Wall : MonoBehaviour {
private AudioSource audio;
void start() {
audio = GetComponent<AudioSource>();
}
void OnCollisionEnter2D()
{
audio.Play();
}
}