unity3d - How to load image from resource folder and set it to source image of UI Image in unity5 -


how load image resource folder , set image source image of ui image?

place sprite in folder begins resources, e.g. mine in "resources/images/test"

[serializefield] private unityengine.ui.image image = null;  private void awake() {     if( image != null )     {         image.sprite = resources.load<sprite>( "images/test" );     } } 

http://docs.unity3d.com/462/documentation/scriptreference/ui.rawimage.html http://docs.unity3d.com/scriptreference/resources.load.html


Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -