I’m trying to load a sprite to my Ui.Image but for some reason i’m not getting any errors or results. I’m not sure how to debug this issue.
public GameObject DisplayImage;
void OnClick( int id ){
DisplayImage.GetComponent<Image>().sprite = Resources.Load("Assets/CharacterImages" + results[id].ImgName) as Sprite; //results[id].ImgName = "/Humans/Soldier"
}
I’m not sure what path works so i’ve tried the following already and none of them work.
- Assets/CharacterImages/Humans/Soldier
- …/CharacterImages/Humans/Soldier
- /CharacterImages/Humans/Soldier
- CharacterImages/Humans/Soldier
Appreciate it if anyone can point me in the direction to figure this out. Thanks.