|
I try to load image by script. But I don't load image. Is there any way to load a texture from a string reference? code public class LearningScript : MonoBehaviour {
} resource
result
(comments are locked)
|
|
You can only load textures, models etc, by using Resources.Load if they are placed under a folder named "Resources" (see the scripting reference for more info). So if you move your sky_02 texture to a folder named "Resources" and change the "iPhone Standard Assets/Textures/sky_02" string to simply "sky_02" it should work. Thanks good answer.
Apr 09 '10 at 07:33 AM
Exotic Utopia
and note you can keep your resources organized in sub-folders and pass the relative path to Resources.Load, for example move sky_02 to Resources/Textures and use Resources.Load("Textures/sky_02").
Apr 25 '10 at 06:42 PM
yoyo
thanks for the answer. It wasnt a very obvious solution. I wouldnt discover that if i didint read this thread..
Dec 28 '11 at 08:54 AM
yigitcan
thanks that did helped me
Aug 16 '12 at 11:42 AM
JeanLuc
(comments are locked)
|



@Exotic, in addition to checkmarking the best answer (which you did), it's helpful to upvote good answers, not only here, but any others that you find useful or informative.
Cyclops: and upvoting requires 15 rep, which Exotic doesn't have yet.