A. The sprite must be converted to a texture first
B. You must use 'rawImg.texture' to assign a sprite
C. RawImage does not have a 'sprite' property
D. The code should use 'rawImg.image' instead of 'rawImg.sprite'
Solution
Step 1: Check RawImage properties
RawImage component uses 'texture' property, not 'sprite'. 'sprite' is for Image component.
Step 2: Understand property mismatch
Assigning 'sprite' to RawImage causes error because it doesn't exist.
Final Answer:
RawImage does not have a 'sprite' property -> Option C
Quick Check:
RawImage lacks sprite property [OK]
Hint: RawImage uses .texture, not .sprite [OK]
Common Mistakes:
Trying to assign sprite directly to RawImage
Confusing Image and RawImage components
Assuming RawImage has 'image' property
5. You want to display a UI element in Unity that shows a texture with custom UV coordinates to create a scrolling effect. Which component should you use and how do you adjust the UVs?
hard
A. Use RawImage component and modify its uvRect property
B. Use Image component and change its sprite's UVs directly
C. Use RawImage component and change the color property
D. Use Image component and animate its color alpha
Solution
Step 1: Identify component for texture with UV control
RawImage supports textures and allows UV adjustments via uvRect property.
Step 2: Understand how to create scrolling effect
Changing uvRect offsets scrolls the texture on RawImage, enabling the effect.
Final Answer:
Use RawImage component and modify its uvRect property -> Option A
Quick Check:
Scrolling texture = RawImage + uvRect [OK]
Hint: Scroll textures by changing RawImage.uvRect [OK]