Complete the code to declare a Sprite variable in Unity.
public [1] mySprite;The Sprite type is used to hold sprite assets in Unity.
Complete the code to load a sprite named 'hero' from the Resources folder.
mySprite = Resources.Load<[1]>("hero");
Use Resources.Load<Sprite> to load a sprite asset by name.
Fix the error in the code to assign a sprite to a SpriteRenderer component.
GetComponent<SpriteRenderer>().[1] = mySprite;The sprite property of SpriteRenderer sets the displayed sprite.
Fill both blanks to create a sprite from a texture and assign it to a SpriteRenderer.
Texture2D tex = Resources.Load<Texture2D>("icon"); Sprite spr = Sprite.Create(tex, new Rect(0, 0, tex.[1], tex.[2]), new Vector2(0.5f, 0.5f));
Use width and height properties of Texture2D to define the sprite rectangle.
Fill all three blanks to load a sprite, assign it to SpriteRenderer, and set its color to red.
SpriteRenderer sr = GetComponent<SpriteRenderer>(); sr.[1] = Resources.Load<[2]>("enemy"); sr.[3] = Color.red;
Assign the loaded sprite to sprite property, load as Sprite, and set color property.
