- Home /
Build file doesn't include image files in Assets
I draw buttons with GUI apis of Javscript like this
function OnGUI(){
if(GUI.Button(new Rect(10,10,100,100),Resources.LoadAssetAtPath("Assets/images/circle.png", Texture2D))){
// bra bra bra
}
}
This script works well on Game view when play button is clicked on Unity Editor.
But images are not shown with built application.
I build apps for PC,Mac,Flash but all of them don't show any images.
build files looks have no image files inside.
Please tell me how to import imagefile with build files.
This is the project file: https://dl.dropbox.com/u/281264/unity/GuiTest1.zip
Thank you.
Answer by Kryptos · Sep 03, 2012 at 11:00 AM
As stated in the documentation, resource assets should be under a Resources folder.
On top of that Resources.LoadAssetAtPath only works in the editor. At runtime you should use Resources.Load.
Your answer
Follow this Question
Related Questions
Texture resolution in Web Build drastically drops 1 Answer
Missing GUI button textures in build. 1 Answer
Distribute terrain in zones 3 Answers
OnGui Function help 1 Answer
Repeat fade in and out 1 Answer