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 WaqarKhan703 · Jun 28, 2014 at 07:53 AM · assetbundlewww

How to Load all textures with WWW class? But not with Assets Bundles

Hello Everyone ,

My question is how to download all textures from the web using WWW class. The reason for not using asset bundles is that, I don't want to recreate asset bundle again and again and upload it to the server after including something(Please correct me about the asset bundles if my concept is not clear about it). I can download one texture using

WWW.texture;

But what if I've to download all the textures from the web and load it once in the game. And after that I can use them. Here is a code snippet ,

 IEnumerator Start ()
 {
      BundleURL = "file://" + Application.dataPath + "/Mydata/tracker-2.jpg";
      WWW www = new WWW(BundleURL);
      yield return www;
      Debug.Log(www.texture.name);
      gameObject.renderer.material.mainTexture = www.texture;
 }

Now Currently, for the sake of testing I'm getting texture from the disk. Later on I'd be accessing it from the server on the web. Just to clarify the purpose my goal is to create a small engine in which I only have to upload texture to the web and update the information xml file retrieving that from web too (I'll be using WWW class to download xml file too). Later on, I can use these textures in my game.

I'll appreciate any help regarding this. Thank you so much guys in advance

Comment
Add comment · Show 2
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 Oana · Jun 28, 2014 at 09:26 AM 1
Share

I'm not really sure what you're asking, as you seem to be on the right track. You just download the xml, and then in a loop of sorts download each texture one by one as you've been doing. I don't think there's a way to do this in bulk.

If the question is about storing them afterwards, you could just make a Texture$$anonymous$$anager class or something, where you store all textures in an array after you download them and use them later on as many times as needed.

avatar image WaqarKhan703 · Jun 28, 2014 at 11:00 AM 0
Share

Thank you so much Oana for replying. I guess I'm not sure how to retrieve all the textures in an array. I don't see any method in WWW class that does the job of returning an array. I'm sorry but I'm noob in program$$anonymous$$g.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by gjf · Jun 28, 2014 at 11:05 AM

look at this to read the texture.

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 WaqarKhan703 · Jun 28, 2014 at 11:20 AM 0
Share

Actually this line written gameObject.renderer.material.mainTexture = www.texture; is just for testing purpose. $$anonymous$$y real concern is how to download all the textures at once. Is there any method in WWW class or any algorithm by which I can get all the textures in an array or something. Thank you any way

avatar image gjf · Jun 28, 2014 at 12:51 PM 0
Share

there is no 'at once'.

if you've got a list/array of the filenames then iterating thru to load/assign textures is easy.

where do you plan on getting the list of files?

i suspect that your answer is from a web page. if so, you'll need to parse the page source... read it into a string and apply some regex to extract the filenames, fix the path names, then load away...

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

21 People are following this question.

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

Related Questions

AssetBundle.mainAsset 2 Answers

How to use same material? 0 Answers

AssetBundle.Unload(false) 2 Answers

what is the faile reason? the model's or my codes'? 0 Answers

how to delete specific files from cache? 3 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