Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 rosariocatena94 · Feb 06, 2019 at 02:03 PM · loading fileexternal files

Read external files from resources

Hello everyone

I'm developing an application with Unity in VR, I need to read a filename, which inserts the user, to be uploaded within the application and other 2-3 options that always the user could choose. I had thought of an initial menu in which to put that data but it is not practical for a VR solution. So I had thought of creating a ' setting ' file where the user, before starting the application, inserts the options, the name and the path of the file from which to load the data. But I do not know how to read a file that is outside the resources of the Unity project. Also how can I create this file setting so that it is always in the same location after I Build the project and is visible within the EXE folder? Would anyone know how to help me? Or maybe give me some advice on how to proceed? Thanks in advance.

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

Answer by Bonfire-Boy · Feb 06, 2019 at 04:50 PM

Yes, with a Standalone Windows build (you don't mention your platform but I'm assuming on the basis of your use of "EXE"), you can do exactly that, using Application.dataPath

We do this with a VR app I'm working on at the moment.

Settings are stored in a sqlite database file alongside the .exe file, which we load using Application.dataPath+"/../"+filename.

The app itself can change the settings, but you can also just load the file into a sqlite browser and modify them that way, or copy a differently set-up db file, all of which is very handy for QA.

And of course it means we can easily change the default settings or deploy differently configured versions just by tweaking the DB file before zipping up the build folder for distribution.

Comment
Add comment · Show 4 · 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 Bonfire-Boy · Feb 06, 2019 at 04:55 PM 0
Share

By the way we also have an initial settings screen of the sort that you reject. Why is that not practical?

avatar image rosariocatena94 · Feb 06, 2019 at 05:46 PM 0
Share

Thank you very much for the suggestion of Application.dataPath. it's just what I was looking for.

As for the initial settings screen is inadequate for me because I have problems with the raycast of the canvas with HTC Vive, so the user should launch the APP, use mouse and keyboard to enter data and then move to VR.

avatar image Bonfire-Boy rosariocatena94 · Feb 08, 2019 at 09:09 AM 0
Share

I guess I misunderstood. That's exactly what our settings screen is like - a different scene with just a UI in which people set things up before entering the VR scene. It is an "initial menu", but not in VR. It's easier for the end-user than editing a file (some of our end-users are not computer literate), but the editing-a-file solution is also available for power users and configuring a deployment.

avatar image rosariocatena94 Bonfire-Boy · Feb 08, 2019 at 10:26 AM 0
Share

my application is for a scientific research. the configuration file is a very simple X$$anonymous$$L where to insert 3 strings with the appropriate comments on what to insert. but of course I understand that if we talk about applications aimed at all the configuration file is not the best choice because many people do not know how to modify it. In my case it will be fine in the future I will insert an initial menu :-) thank you very much for the advice :-)

avatar image
0

Answer by misher · Feb 06, 2019 at 02:08 PM

Your application can read files from a specific folder, it is there you should put files. The folder is different for platforms: docs

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 rosariocatena94 · Feb 06, 2019 at 02:12 PM 0
Share

So I can't create a file in the Build folder where the user can enter the file path and the other options?

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

99 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 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 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 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 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

Unity Crashes every time i add .obj file to scene 1 Answer

How to load non-asset resources at runtime 0 Answers

How do I call a File outside Unity without the Location? 3 Answers

How to load external assets WITHOUT assetbundles? 1 Answer

Loading parts of file (Multiplatform) 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