Делал по курсу. Там всё работало. Object reference not set to an instance of an object. Unity. С#
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Buttons : MonoBehaviour {
public Sprite button, pressed;
public bool music;
private Image img;
void Start () {
img = GetComponent <Image> ();
}
void OnMouseDown () {
img.sprite = pressed; // Тут ошибка
}
void OnMouseUp () {
img.sprite = button; // И тут
}
}