I am getting the
NullReferenceException: Object reference not set to an instance of an object
for both rows that feature the SendEmail button, regardless of wich button I assign in the inspector. Any ideas? Thanks in advance!
I don't think this represents a duplicate, because in this code are two exactly identical button funtions. One works (TakePhoto), the other one not so much (SendEmail).
Edited to take Bijans and Bidous comments into account, dosen't fix it.
public class Picture : MonoBehaviour {
public Button TakePhoto;
public Button SendEmail;
void Start () {
TakePhoto.onClick.AddListener (TakePhotoTask);
SendEmail.onClick.AddListener (SendEmailTask);
}
void Update () {
if (ssCount == 0) {
SendEmail.interactable = false;
} else if (ssCount == 3) {
TakePhoto.interactable = false;
}
}