- Home /
How add file to resources folder?
Hello!
I created a button, and I want to open a file:
if (GUILayout.Button("Open file"))
{
Application.OpenURL("file:///" + Application.dataPath + "/Resources/fileName.pdf");
}
In the editor it works, with some changes, but I don't no, how to add the file, to the resources, when I create the build.
How can I add the file to the Resources folder, when create a build?
Answer by illiterate · Feb 21, 2012 at 10:20 PM
As far as i know, as long as you have the file in the following location, it should be built into the game automaticly.
project folder\Assets\Resources{yourfolderstructure}{Yourfiles}
Answer by Berenger · Feb 21, 2012 at 10:02 PM
The point of the Resources folder is to tell Unity that everything in it must be packed in the final .unity3d, whereas the other assets are packed only if a GameObject is using them explicitely. Conclusion, there is no Resources folder once the game is built.
I think you are looking for asset bundles.
Answer by Zyklon · Feb 22, 2012 at 07:08 PM
I understand, but: 1. create a new porject 2. import a .pdf file 3. ??? 4. create a script 5. build After that the .pdf file should be locate in the resources folder (project_folder/build/project_name/resources), because the file don't will be there, you can't open it.
I don't now how can attach this file to a scipt. Asset bundles how works?
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Prefabs are instantiated in editor but not in executable 2 Answers
Load resources the scene depend on but not in "Resources" folder 1 Answer
Web Player build not including Resources folder 0 Answers
Resource.LoadAll not working in build (works in editor mode) 2 Answers