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 ronronmx · Sep 08, 2011 at 07:08 AM · pathfindingresourcesapplication

iPhone build doesn't copy existing files in Application.dataPath or .persistantDataPath?!

This is really making me bang my head against the wall! I can't use a TextAsset because I'm loading an .ini (.txt works, but the parser needs a full path) and I can never get the file to be included in the iPhone build. Works great in the Editor!

I tried using both Application.dataPath and Application.persistantDataPath, but since I'm only trying to read data that's already there (I am not writing anything to these folders on startup), it can never find it when I build to the iPhone because the file doesn't exists, even if I put it in the "Resources" folder!

It blows my mind how complicated it is to read a already existing file on the iPhone without using a internet address or a TextAsset!

Am I missing something? I thought everything you put in the Resources folder was included in the final build? If so, then:

 StreamReader reader = new StreamReader(Application.dataPath + "/Resources/Upgrades.ini");

should load fine on the iPhone build, correct? I always get the following error:

An exception was thrown by the type initializer for UpgradeSettings ---> System.IO.IsolatedStorage.IsolatedStorageException: Could not find a part of the path "/var/mobile/Applications/71B40B89-36BE-43D6-B69D-5D02A7E5AFE3/braaapgame.app/Data/Resources/Upgrades.ini".

I do not want to use XML (in which case using a TextAsset works wonders), but it looks like I might have to after all???

Any help would be, as always, greatly appreciated! Thanks for your time... Stephane

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 sendel76 · Sep 09, 2011 at 11:25 AM

I am not sure, but may be trying to put the streaming assets in "/Assets/StreamingAssets" instead of "/Assets/Resources". May this is only for streaming videos - but may be not.

if you dont want to load a stream, try using "LoadResouce" function:

 string filename="Upgrades.ini";
 TextAsset myTextAsset = LoadResource(filename) as TextAsset;
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

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

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

A* Pathfinding Bug: Dictionary Key Not Found Exception 1 Answer

How to get Resources filepath on Android device? 2 Answers

build android apk that contain Resource XML 0 Answers

How would I create a Pacman enemy in 2D? 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