Search Feedback

183
votes

List Assets in Resources folder

Assets

-

-

There are many games where you have to load and unload assets at runtime.
Currently in Unity the only way to make it is through Resources folder.
The problem is that once is compiles, the only way to get a list of assets in Resources folder is using Resources.LoadAll(), but this is a problem because it will load the assets and WILL FILL THE MEMORY.

I want to get a list of available assets in resources folder, to decide at runtime what assets i want to load.

I don't know why this is not implemented yet, the first thing you need when working with assets is a list.

There are some post also asking for this:
http://answers.unity3d.com/questions/460161/how-do-i-get-a-list-of-filenames-in-a-resources-fo.html
http://answers.unity3d.com/questions/610777/find-all-objects-in-resource-folder-at-runtime-wit.html
https://forum.unity3d.com/threads/how-to-get-list-of-assets-at-asset-path.18898/

I hope you implement this very soon.
Tanks and Regards.

Comments (5)

  1. 41b66d98dcb03dda16f854460870dc8b?d=mm

    DADA_universe

    Apr 13, 2017 09:02

    I'm having similar issues and I think the suggested command for Resources.GetAllAssetNames would make a lot of sense.

  2. 5f7d74ca5f53b77957e0567869ba09b5?d=mm

    CarlosBCV

    Feb 05, 2017 13:53

    To ANDYMADS:
    That's what I’m doing wright now. I'm building a custom file to know what assets are in Resources folder, but it seems a loose of time when it should be as simple as a command like Resources.GetAllAssetNames.

    To RICHARDFINE:
    Yeah, AssetBundles can do the job when loading from a file, thanks for the advice.
    https://docs.unity3d.com/Manual/AssetBundleCompression.html
    But it is still a workaround, build AssetBundles for each platform, and include the correct into each build. All that could be avoided with a simple command like Resources.GetAllAssetNames.

  3. 5a7ae1cfd512dacc0bb14af4b23da76a?d=mm

    RichardFine

    Feb 04, 2017 13:02

    Switch to using an AssetBundle instead; AssetBundle.GetAllAssetNames will then tell you what assets are in the bundle.

  4. 5c58a8c8cfdba8d8212c2eb81e56691c?d=mm

    andymads

    Jan 31, 2017 10:11

    Should be fairly straightforward to do this yourself though in the meantime? Have an Editor script search all Resources folders and write the list out to a file or custom asset (ScriptableObject).

  5. F84e4c9acfba59e0ea23eb35f637bc02?d=mm

    FullMe7alJacke7

    Jan 29, 2017 12:04

    I am also trying to do something similar, being able to load periodically from a custom folder in resources would be ideal. As I want to have a crafting system in my game that will be completely customized by the user and being unable to properly load resources without Resources.LoadAll with 5000+ prefabs + custom items the players make.

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(9356)

2D

(241)

Ads

(43)

AI & Navigation

(71)

Analytics

(106)

Animation

(330)

Asset Store

(243)

Assets

(497)

Audio

(159)

Cloud Build

(102)

Collaborate

(33)

Docs & Tutorials

(203)

Editor

(2160)

Everyplay

(13)

Game Performance Reporting

(15)

General

(831)

Graphics

(791)

GUI

(373)

Input

(150)

Licensing

(77)

Networking

(163)

Physics

(349)

Platforms

(413)

Profiling & Optimization

(72)

Runtime

(164)

Scripting

(1044)

Terrain

(152)

WebGL

(134)