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 pretender · Nov 19, 2011 at 08:30 PM · imageassetwwwdownload

few questions about using www for getting bunch of images...

the thing i made works in editor and it is using www to get the images and show them as textures. here is the part that does that:

 // Start a download of the given URL
 var www = new WWW("file://"+imageListFullPath[currentImageIndex]); 
                                     
 // wait until the download is done
 yield www; 
                                     
 // assign the downloaded image to the main texture of the object
 tImages=www.texture;

this works good in the editor, ofcourse i am using http:// protocol when webplayer is uploaded to a server. but it does not work. it freezes. so to figure out what is going on i have to ask somebody more experienced to help me.

  1. to get the list of all images in the folder i use this call from System.IO:

    if(Directory.Exists(imageDir)){

    //GET THE LIST OF IMAGES IN THE DIRECTORY var images : String[]=Directory.GetFiles(imageDir+shortName+"/");

    } is this making a problem? can i get the list of files inside the folder through web player if the files are on the same server, i know that webplayer can not access local files from secuirty reasons?

  2. When running from the editor, the folder that contains images is located here Application.dataPath+"/imageDir/", it seems that this is asset folder, so any change to this folder, like adding images to it, unity reimports assets. is this really needed, can i use some generic folder path that is outside of the asset folder?

  3. When webplayer is built, where to put the image folder in relation to webplayer so i can read the files properly. This goes for local webplayer and uploaded to server?

  4. Can anything be done with memory leak that is caused by downloading textures this way, memory does not go free when textures are not used any more?

I was frustrated the most of things worked properly in editor but when i tried to upload to server it crashed. basically it could be something really simple but i can not see it...

Thanks in advance for looking into this, it's appreciated!

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 pretender · Nov 20, 2011 at 05:59 PM 0
Share

any ideas here?

avatar image Eric5h5 · Nov 20, 2011 at 07:02 PM 0
Share

You can't use System.IO in a webplayer, period. Any web access has to go through WWW.

0 Replies

· Add your reply
  • Sort: 

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

Loading images from web to editor window 3 Answers

www download strange...help 0 Answers

Downloading image from the server crash the game in Android Device ? 1 Answer

Localhost does not work after launching build from hosting 1 Answer

Downloading files in the Editor 2 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