Closed imZEH closed 7 years ago
I didn't understand what you are talking about. Do you want to know how to copy a file from Resources folder to another place?
Yes2x. but i think I'm in the wrong section to ask this question. Will Anyway yes I want to auto copy files when building the project.
A simple solution, that I use in my projects:
Put your file in the Resources folder, and rename it to add the ".txt" extension. Example: (mydatabase.db.txt)
Now you can to copy it from Resources to another place, like this:
TextAsset defaultDBTextAsset = Resources.Load("mydatabase.db") as TextAsset; // Dont use the .txt extension
string targetPath = System.IO.Path.Combine(Application.persistentDataPath, "mydatabase.db") ;
File.WriteAllBytes(targetPath , defaultDBTextAsset.bytes);
I was expecting on unity engine tool you can find something that check configurations , you'll just check some settings. I was not expecting to do some code staff. but Anyways thank you this could be a big help.
Hello,
I just want to ask on how to fix auto copy files inside the folder Plugins when unity Build the app.