Hi guys,
I am new to unity.
I was trying to load an image on disk to a Unity UI Image via c# script.
I have my resource Desert.jpg in my Resources folder.
Sprite mySprite = Resources.Load(“Desert”) as Sprite;
if (mySprite == null) {
Debug.Log (“Null”);
} else {
Debug.Log (“loaded”);
}
//backGroundImage.GetComponent().sprite = mySprite;
and this is what i was trying.
the log always prints Null