Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by kingdutka · Sep 21, 2011 at 07:32 AM · filedependenciessave game

How do I include a custom file in my build?

I have 6 save game files that are created using C# serialization. I need these files to be included in my build. With a PC version, I can simply copy/paste the needed files into the final build folder. Under Android, due to it packing everything into a *.apk file, I am unable to include the needed game save files. I tried placing them in the Assets/Resources/saves folder and even added a new JS file with the following code:

 function Start(){
     Resources.LoadAll("saves");
 }

But Unity is still not packing my save files into the build...

How can I tell Unity that these files are required and make them part of the build??

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image asafsitner · Sep 21, 2011 at 08:23 AM 0
Share

Try putting them into a file named Resources

avatar image kingdutka · Sep 26, 2011 at 07:44 AM 0
Share

Tried the "Resources" folder... still not working. I might resort to creating a 'gaveSaves.js' that is nothing but a list of every variable for each of the game saves... At least that way I know where my info is, how to access it, and am guaranteed it will be included... Downside is the amount of code re-writing...

avatar image kingdutka · Nov 02, 2011 at 07:22 AM 0
Share

Still seeking an answer to this one... Hoping this comment serves to "bump" my question...

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by kingdutka · Nov 29, 2011 at 07:23 PM

I got them working under Android. The problem was resolved when I imported them in the Editor, instead of copying them into the directory.

-arsalank2

Sounds like Occam's Razor!! The best answer is the most obvious... Thanks!!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image geniuscd · Jan 03, 2013 at 04:24 PM 0
Share

hello, Im trying to do the same thing! its not working... how did u managed to add them using the import inside unity editor? I tried it.... its not adding my files to the built... please advise..

avatar image
0

Answer by CHPedersen · Nov 02, 2011 at 07:48 AM

Heya,

I'm not developing for Android, so bear with me if this doesn't help you, but I did a quick google to try and find a solution for you.

According to this question on how to save and read data on android, you can either use PlayerPrefs to store the variables that define a saved game, or if the data you need included is unsuitable for PlayerPrefs, you can store the files on the SD card and read/write using Application.persistentDataPath. I think that's the way to do this - you don't need the data embedded in the Unity build.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by arsalank2 · Nov 24, 2011 at 09:34 PM

I have exactly same the question. Resources do not seem to work for Android. Does anybody has an answer?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image arsalank2 · Nov 29, 2011 at 05:59 PM 0
Share

I got them working under Android. The problem was resolved when I imported them in the Editor, ins$$anonymous$$d of copying them into the directory.

avatar image 3DOR · Apr 29, 2015 at 07:13 AM 0
Share

"I got them working under Android" where should i open this "Android" folder?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Possible to make build output clean? 1 Answer

Reading/Writing to a text file on non-windows platforms 1 Answer

Load a jpeg from the users drive to use as a texture in a standalone build? 1 Answer

File handling in unity? 0 Answers

Drag and Drop error 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges