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 /
This question was closed May 04, 2014 at 01:24 PM by thornekey for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by thornekey · Apr 30, 2014 at 11:17 AM · c#arraysexplorer

Make Gallery from Array

Hi, I would like to have a folder that I can specify from string (I kind of know how to do this so far.) But I would like an array, and any, say: Movies or images - that go into the folder go into the array, and it can let you view them with the video texture feature..

How would I go about starting something like this?

Thanks

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

  • Sort: 
avatar image
1
Best Answer

Answer by ArkaneX · Apr 30, 2014 at 12:25 PM

You can use classes from System.IO namespaces to achieve what you want. To get array of file paths, use Directory.GetFiles method. Having these paths, you can load the images/videos with WWW class, and access texture using WWW.texture or WWW.movie

Now the sad part... Remember, that Unity can only load PNG/JPG images and Ogg Theora videos. If you want to support other image formats, e.g. BMP, you'd have to convert them on the fly to one of Unity supported formats. You'd need a custom solution for this though. For example, you can use System.Drawing.Bitmap, but only if you target Windows (and possibly Mac/Linux - never tried it).

I know of no easy way to handle other video formats though. Transcoding on the fly would be impossible in real time, so I think the only solution is to use a MovieTexture alternative, if you find any...

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 thornekey · Apr 30, 2014 at 01:25 PM 0
Share

Thanks for your help! :) this has helped me further develop what I am trying to do. As for the movie files, Ive never heard of Ogg Theora videos.. is it a type of format? Ive used .mov before and that works fine.

avatar image ArkaneX · Apr 30, 2014 at 01:58 PM 0
Share

For more info about this format, take a look at wikipedia.

In Unity, you can use other video formats as well, but all video assets are internally converted to Ogg Theora (unless they are already in this format). If you read non-Theora movie from disk, then playing it won't be possible, as for Unity the format is unknown - there's no way to transcode on the fly.

Ogg Theora requirement is described in the documentation of WWW.movie and $$anonymous$$ovieTexture.

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

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Unity c# indexoutofrangeexception: array index is out of range 1 Answer

Best way to keep track of objects on a 3D Grid? 2 Answers

How to debug values in jagged arrays? 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