• 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 yosh · Feb 05, 2010 at 10:28 AM · iphone

Possible to create apps that store data on the iphone and load them at runtime?

Hi,

im about creating an unity iphone app and need to work with lots of 480x320px images. At the moment ive imported about 72 pictures as 512x512 textures, so unity can compress them. After building that iphone-app, i looked into the "Editor.log"-files to know which complete size my project has and im about 11 MB now.

After building and starting the performance tools with xcode (run-run with performance tool-activity monitor) it shows about 26 MB of "real memory" and runs great. Ive tested it with more images and by more than 40MB, the app crashed down.

My questions:

  • Where does the size-difference from 15 MB comes from?
  • Can i build assets with any desired amount of images that will be stored on the iphone but will be loaded (with the WWW-class) at runtime when needed ?

(For example a navigation-app has about more than 700MB if you download it from the appstore, but if you start that app, it has to work under the 40MB ive mentioned above. Is that right?)

Thanks for your time and help.

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

2 Replies

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

Answer by Mantas-Puida · Feb 05, 2010 at 03:29 PM

  1. 15 MB = ~10+ MB for application binary code + something for .NET heap + something for engine internals + some other stuff.
  2. You can put your resources into "Resources" folder and load them later via Resources.Load() function.
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 yosh · Feb 08, 2010 at 10:34 AM 0
Share

@$$anonymous$$antas Puida: Ive tested both by creating an prefab and then: 1. Loading the assetbundle via WWW-Class 2. Loading the prefab via "Resources"-Folder

If loading via www-class, the textures arent in the unity build -> so everything works fine like i thought. But so the user need to download by every start of the app.

So i tested it with the Resources-folder, but when i build the unity-iphone app, the data in the resources-folder will be included directly in memory of the app. So when i put all my stuff in the resources-folder, it brings no advantage if its already included, isnt it??

avatar image Mantas-Puida · Feb 09, 2010 at 02:35 PM 0
Share
  1. All the content that you download via WWW class you can cache via .NET File API. Please take a look at "Preparing your application for "In App Purchases" section in Unity iPhone manual.

  2. Unity engine loads only these resources, which are directly referenced from scene. If you place some resources into "Resources" folder, but don't make "hard" reference from scene, they will be loaded only when yo call "Resources.Load()" function.

avatar image
1

Answer by Ryuuguu · Feb 05, 2010 at 02:10 PM

I'll answer the question in the title not the body of your question. Yes you can store files of arbitrary size in the file system. You can get them into the file system either by including them in your xCode project or downloading them with WWW class. Use .Net usual file classes to work with them.

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 yosh · Feb 05, 2010 at 02:32 PM 0
Share

Thanks for your fast reply. Can you please say which .net file classes you mean? With unity-javascript-code it wont work?

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Dynamically choosing a high resolution texture at runtime on iOS devices 1 Answer

shadow on plane for iphone 3 Answers

HELP!! OnCollisionEnter is not working when i built it out on IPHONE! 0 Answers

how to load ogg files from documents folder. 1 Answer

smooth transitions for Rigibodies objects on iPhone and iPad 1 Answer


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