mysprite = Resources.Load(“Images/down”,typeof(Sprite)) as Sprite;
GameObject go = new GameObject("up");
SpriteRenderer renderer = go.AddComponent<SpriteRenderer>();
renderer.sprite = mysprite;
Vector3 center = new Vector3(18,46,0);
go.transform.position += center;
The object up is created and attached to the game.
But the image down.png which is in Images folder is not attached to the sprite renderer
Sprite : None (Sprite)