With this usage, the sprite does not change:
public void SetCubeType(string cT)
{
cubeType = cT;
gameObject.GetComponent <SpriteRenderer> ().sprite = Resources.Load <Sprite> ("Sprites/Cubes/" + cubeType);
}
but this works good
gameObject.GetComponent <SpriteRenderer> ().sprite = Resources.Load <Sprite> ("Sprites/Cubes/Fire");
If I check the value of “cubeType” through Debug.Log() it is equal to “Fire”
What’s wrong?