Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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
1
Question by DarmMan · Aug 06, 2015 at 09:25 PM · android buildtxtandroid iphone

System.IO don't work on android

I have to load some txt file's in my game and I was using System.IO to do that with commend System.IO.ReadAllLines and it works completely fine on computer in unity but don't work after building on samsung with android so please what should I do or what I can use instead system.IO to read txt file's on smartfon's and it would be great if it work also with telefon's with ISO, thanks

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Positive7 · Aug 06, 2015 at 09:27 PM

System.IO should work fine in Android. however PC and Android stores files in different location. So you might want to check that out or post some piece of the relevant script.

Comment
Add comment · Show 3 · 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 DarmMan · Aug 07, 2015 at 11:28 AM 0
Share

I red that I have to move file's to Resources file so my location path's look are:

     string path_poziom_pierwszy = @"Resources/poziom_pierwszy.txt";
     string path_poziom_drugi = @"Resources/poziom_drugi.txt";
     string path_poziom_trzeci = @"Resources/poziom_trzeci.txt";


then I use this to turn txt file into a string table because in specific line I have specific numbers

 poziom_pierwszy = System.IO.File.ReadAllLines(path_poziom_pierwszy);
 poziom_drugi = System.IO.File.ReadAllLines(path_poziom_drugi);
 poziom_trzeci = System.IO.File.ReadAllLines(path_poziom_trzeci);


what may be wrong with direction?

avatar image DarmMan · Aug 07, 2015 at 12:06 PM 0
Share

so I'am using: using System.IO;

$$anonymous$$y location path's are:

 string path_poziom_pierwszy = @"Resources/poziom_pierwszy.txt";
 string path_poziom_drugi = @"Resources/poziom_drugi.txt";
 string path_poziom_trzeci = @"Resources/poziom_trzeci.txt";


I have in Awake function this:

 poziom_pierwszy = System.IO.File.ReadAllLines(path_poziom_pierwszy);
 poziom_drugi = System.IO.File.ReadAllLines(path_poziom_drugi);
 poziom_trzeci = System.IO.File.ReadAllLines(path_poziom_trzeci);

On computer it works fine but on android it won't work at all. What's wrong with my resources file, help, thanks

avatar image Positive7 · Aug 07, 2015 at 07:05 PM 1
Share

It's because they're in Resources folder The file doesn't exist there the same way as in the project http://wiki.unity3d.com/index.php/Special_Folder_Names_in_your_Assets_Folder#.22Resources.22

you could try to use : Resources.Load(); or WWW should work too.

Sorry for delayed answer

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

System.IO don't work with android 0 Answers

how put txt file into android package 1 Answer

My android game freezes if I don't touch for 2 min 1 Answer

Exporting Google Android project from Unity 4 to Android Studio issue 0 Answers

how to use socket connection of android device in unity game app?,how to use socket data of bluetooth android in unity? 0 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