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
2
Question by shingo · Aug 27, 2012 at 09:07 AM ·

How to use EditorUtility.OpenFilePanel to filiter multi extensions?

I want to use EditorUtility.OpenFilePanel to open audio files, but it contains only one extension parameter. I have tried "mp3;ogg", "mp3|ogg", ".mp3;.ogg", ".mp3|.ogg", but they all failed. So is this function possible to filiter multi extensions?

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 DydyUni6 · Aug 22, 2013 at 08:45 AM 0
Share

I've got exacly the same problem, I want to open .xls and .xlsx files. Did you find a solution to your problem ? Sorry I know its been a year already ...

avatar image Tehelee · Sep 04, 2014 at 04:27 PM 0
Share

I've been struggling with this since Unity 3.5, does anyone have anything verified that works?

7 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by tea42 · Sep 09, 2016 at 05:41 PM

If anyone is still interested in a solution for this, using comma separators worked for me : EditorUtility.OpenFilePanel("Select Image", dir, "png,jpg,jpeg,tif,tiff,gif,bmp")

Comment
Add comment · 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
2

Answer by krzysztofuken · May 03, 2018 at 05:08 PM

Use the other method

EditorUtility.OpenFilePanelWithFilters

    /// <summary>
     ///   <para>Displays the "open file" dialog and returns the selected path name.</para>
     /// </summary>
     /// <param name="title">Title for dialog.</param>
     /// <param name="directory">Default directory.</param>
     /// <param name="filters">File extensions in form { "Image files", "png,jpg,jpeg", "All files", "*" }.</param>
     public static string OpenFilePanelWithFilters(string title, string directory, string[] filters)
Comment
Add comment · 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
-2

Answer by Gius · Oct 09, 2012 at 03:48 PM

Just use the semicolon:

.mp3;.ogg

Comment
Add comment · 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
0

Answer by KristofR · Aug 23, 2013 at 09:21 AM

You have to specify with "*" so use "*.mp3;*.ogg;".

Works fine for me.

Comment
Add comment · Show 1 · 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 Tehelee · Sep 04, 2014 at 04:25 PM 0
Share

This does not work for me, has anyone found anything that does?

I'm trying to open JPEG and JPG files.

I've tried:

".jpg;*.jpeg;"

"\".jpg;*.jpeg;\""

'".jpg;*.jpeg;"' -This errors with single quotes around it

How does yours work? I'm in Unity 4.3 currently.

avatar image
0

Answer by ZhongQi · May 09, 2016 at 04:59 PM

maybe can try : "extension1;*.extension2;*.extension3"

the first don't add "*." the last don't add ";"

like "jpg;*.jpeg"

:)

Comment
Add comment · 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
  • 1
  • 2
  • ›

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

18 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

Related Questions

Adding Images 1 Answer

Priority Queue Code Problems 1 Answer

Wierd view 0 Answers

Decorative Pathways 0 Answers

Why using this way class attributes are omitted? 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