• 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
Question by dreal · Apr 16, 2011 at 05:15 PM · assetsresourcesfilesexternalvideos

How to load objects from a file outside of unity3d

Hi,

Is their a way to load files (videos, images) from outside of unity3d assets directory?

What i mean is if you program in a text field function and a button to search your directory on your hard drive for videos and images, would they show up dynamically in the standalone application when i try to search for a file? If so, can i get an idea of how t$$anonymous$$s might be done? I know that t$$anonymous$$s can be done on the server side of t$$anonymous$$ngs, but the client i am working for wants to search for all $$anonymous$$s files on $$anonymous$$s hard drive. I know if i try to use resource.load(), it won't work since it has to be wit$$anonymous$$n the the unity assets directory.


Ok thank! So can all t$$anonymous$$s be done on the Iphone using xcode?

Comment

People who like this

0 Show 0
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

3 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by AliAzin · Apr 16, 2011 at 05:27 PM

you can use System.IO for searc$$anonymous$$ng in directories and you can load video(ogg format) and images(png) using WWW class in unity. The only t$$anonymous$$ng you should do is pass your file path like t$$anonymous$$s :

var url = "file://c:/fridays.jpg"; function Start () { // Start a download of the given URL var www : WWW = new WWW (url);

 // Wait for download to complete
 yield www;

 // assign texture
 renderer.material.mainTexture = www.texture; 

}

see WWW class reference in docs

Comment
Bunny83
Uzquiano
dreal
Sondre-S

People who like this

3 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 dreal · Apr 19, 2011 at 04:50 AM 0
Share

Ok thanks! So can all this be done on the Iphone using xcode?

avatar image AliAzin · Apr 19, 2011 at 05:30 PM 0
Share

I don't have the iphone version, but it should work with iphone too.

avatar image
Best Answer

Answer by Uzquiano · Apr 16, 2011 at 06:04 PM

Hi,

For text files I do like t$$anonymous$$s:

private var file : String = ""file://c:/files/file.txt";

var reader : StreamReader = File.OpenText(file);

Comment
dreal

People who like this

1 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 dreal · Apr 19, 2011 at 04:46 AM 0
Share

Ok thank! So can all this be done on the Iphone using xcode?

avatar image Uzquiano · Apr 19, 2011 at 08:07 AM 0
Share

Well... I have never develop Unity for iPhone but I think it should work. And about Xcode, it is only a tool, what matter is what you write in there ;)

avatar image

Answer by ravi_gohil999 · Jan 24, 2013 at 06:51 AM

You need to use file:///c:/.... to let t$$anonymous$$s file protocol work....3 slashes

Comment

People who like this

0 Show 0 · 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.

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

1 Person is following this question.

avatar image

Related Questions

Difference between Resources folder Vs normal folder 0 Answers

Why does my Unity project contain tens of thousands of files when the actual game assets is far less? 2 Answers

How can I load an custom file from the Assets folder? 2 Answers

How can I Instanciate a Prefab as it gets loaded from a LoadAssetsAsync,How can I Instanciate a Prefab as it gets loaded from a LoadAssetsAsync with Addressables? 1 Answer

Write to XML-file within Assets\Resources 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