Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 grey · Jul 19, 2010 at 10:00 PM · iphoneupdateassetserver

iPhone: Update Assets from Web?

I'm working on a project where the client wants to be able to update certain text based data assets and maybe select image assets that are stored locally on the phone without needing to issue a formal application update through the iTunes Store. Is this possible?

Assuming any kind of update is possiblem, if there were new icon images to go with things added to the text assets, would it be possible to store entirely new assets?

I'm totally new to iPhone development, and fairly new to Unity as well, so any insight would be appreciated.

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
1
Best Answer

Answer by spinaljack · Jul 20, 2010 at 12:13 AM

You can have your app look for new asset bundles from a server and download them if necessary using the WWW class.

From the iphone docs:

var download : WWW;

 var url = "http://somehost/somepath/someassetbundle.assetbundle";

 download = new WWW (url);

 yield download;

 assetBundle = download.assetBundle;

 if (assetBundle != null)
 {
     // Alternatively you can also load an asset by name (assetBundle.Load("my asset name"))
     var go : Object = assetBundle.mainAsset;

     if (go != null)
         instanced = Instantiate(go);
     else
         Debug.Log("Couldnt load resource"); 
 }
 else
 {
     Debug.Log("Couldnt load resource"); 
 }

You can then save the data to a documents folder on the device

Again from the docs:

public static string GetiPhoneDocumentsPath () 
        { 
                // Your game has read+write access to /var/mobile/Applications/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Documents 
                // Application.dataPath returns              
                // /var/mobile/Applications/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/myappname.app/Data 
                // Strip "/Data" from path 
                string path = Application.dataPath.Substring (0, Application.dataPath.Length - 5); 
                // Strip application name 
                path = path.Substring(0, path.LastIndexOf('/'));  
                return path + "/Documents"; 
        }

You can also simply download a texture or some text from a website and use them directly in your game without using asset bundles if you prefer. You do this by setting up a new WWW and storing the returned text as a string with www.data

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 grey · Jul 20, 2010 at 04:44 AM 0
Share

I need to test this, of course, but I'm certainly giving you the answer for now! Thanks so much! Super helpful!

avatar image grey · Jul 20, 2010 at 04:45 AM 0
Share

One brief additional question, if you happen to know, is that documents folder backed-up with the rest of the iPhone data when iTunes does it backup?

avatar image spinaljack · Jul 20, 2010 at 10:38 AM 0
Share

Backup saves data such as music, applications, podcasts, videos, ringtones, photos, notes, email account settings, contacts, calendars, and bookmarks. So yes, the whole 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

No one has followed this question yet.

Related Questions

Animations lose their links upon updating from Asset Server -2 Answers

Asset Server problems. Old updates appearing in updates list after deleting assets 1 Answer

Best way to load information from server? 0 Answers

Rename a project on the asset server? 3 Answers

when will the asset store tools be updated? 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