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 /
This question was closed Apr 28, 2017 at 02:00 PM by Landern for the following reason:

This is not unity specific, though there are examples on this very site, please use the system.io namespace and provided classes/methods.

https://www.google.com/search?q=c%23+load+file+from+computer

avatar image
0
Question by sima11 · Apr 28, 2017 at 01:53 PM · c#unity 5assetbundleresources.load

How to load a file during runtime? (Resources folder doesn't work)

Hey guys, I have been trying to solve this for quite a while now, but I can’t figure it out. I am creating an editor for a game and I want to allow designer to make new spells. I need to be able to laod a file during runtime from a folder. I know that Unity has Resources folder for that. But it only works if I put the object file to the Resources folder through Unity. I need to be able to put a file into the Resources folder outside of Unity (just through the file system). Is there any way to do that? The code for Resources file is :

  public void LoadParticle(string name)
     {
         GameObject myParticle;
         myParticle = (GameObject)Resources.Load(texturePath + "/" + name, typeof(GameObject));
         if (myParticle == null)
         {
             print("Cant find particle");
             cont = false;
         }
         else
         {
             particle = myParticle;
             cont = true;
         }
     } (cont is just a variable that I use to determine if I should keep creating a new spell or not)

What I am trying to achieve is that a designer will download a Unity particle system, save it on the computer and will give the game full path to it. Then the game should load the object and use it as a particle for a new spell.

I also tried it with Asset Bundles, but I don’t know how to use Asset Bundles when I only want to download the file from the computer (local file system) not from the server. Asset bundles work perfectly in Debug but not when I build and run it (It tries to connect to some server instead). Thank you so much

Comment
Comments Locked
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

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to load a single GameObject from an AssetBundle without a specific name ? 0 Answers

Unity 5 Resources.LoadAsync on Android slower than iOS? 0 Answers

Alternative to BuildStreamedSceneAssetBundle ? 0 Answers

Multiple Cars not working 1 Answer

Requesting help utilizing resources.load to auto assign rigidbody variable in a class list 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