Some of my scripts have suddenly started showing compiler errors for no apparent reason.Essentially they all have a variation of this kind of thing:
using UnityEngine;
using System;
using System.Collections;
using UnityEngine.UI;
public class sampleScript : MonoBehaviour {
public Sprite m_Sprite;
public Image title_Image;
void Start (){
title_Image.sprite = m_Sprite;}
}
And are showing a compiler error like this:
‘Image’ does not contain a definition for ‘sprite’ and no accessible extension method ‘sprite’ accepting a first argument of type ‘Image’ could be found (are you missing a using directive or an assembly reference?)
It doesn’t make any sense to me…It was working fine an hour ago, and I haven’t done anything to these scripts in that time…
Any idea what is going on here?