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 abuklea · Mar 24, 2015 at 06:30 AM · dragdropexternaldrag and drop

Drag and drop an external file/folder into a running game window?

Hi all,

Is there any way I can drag and drop an external file or folder into a running Unity game window, and at least be able to determine the file path?

I am basically wanting to create a model viewer and would be very handy to do this, but having trouble finding information on whether this is possible or not.

thanks,

Allan

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by soft_sound · Mar 25, 2015 at 01:13 AM

I'm not sure about drag and drop but it is quite possible to get the path of any asset or load an asset from an external source.

var path = EditorUtility.OpenFilePanel("Load RTF note file", "", "");

I use this to load notes into Unity.

There is also the whole AssetDatabase thing to check out.

AssetDatabase.GetAssetPath

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 abuklea · Mar 25, 2015 at 02:06 AM 0
Share

Thanks, I've used that approach before and that will be a good enough solution for now. Really only for convenience being able to drag-drop.

Cheers

avatar image soft_sound · Mar 25, 2015 at 03:54 AM 0
Share

If my comment was useful you could make it as an answer ;)

Also this similar post may help you more. -> Applying variable from project

The post refers to ObjectNames.GetDragAndDropTitle which might be useful, never tried it so I don't know.

This may be useful later if you want more stats from your model $$anonymous$$odelImporter Class

avatar image
2

Answer by Astiolo · Feb 22, 2018 at 03:50 AM

Bunny83 has made some code that can do this. It's really simple to use. https://github.com/Bunny83/UnityWindowsFileDrag-Drop

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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Drag and drop files from the assets folder to another folder not working 0 Answers

Duplicate Object, by dragging? (SporeCreatureCreator Like) 0 Answers

Coding Advice Needed: Building a 2D ship editor 1 Answer

Help starting a card app 0 Answers

Drag, Hold, Catapult 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