Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

If Asset Bundles are so great, why asset author keep using Resources folder?

Discussion in 'General Discussion' started by bitinn, Dec 1, 2018.

  1. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    958
    Every time I encounter a thread that talks about how to use Resources folder there are inevitably people jump out saying "you don't", follow by old timers liking such comment.

    I get it, Resources folder are bad for memory management, but here is my question: why do asset authors keep using them? Putting just about every variant of they shaders in Resources folder, most of them you probably never use.

    AFAIK, these authors are competent, so my guess is:

    - shaders are small so they are fine.
    - the numbers are often sub 100, so startup serialization don't take that long.
    - they are just making life easier for themselves.

    But really, if there is an OK-line for Resources folder, please say that, don't say "you don't".

    /rant over
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Asset bundles are required to be compiled for each platform and unity version, which gives them a distinct disadvantage over the resources folder.

    That said, the asset store isn't exactly known for enforcing best practices. It's entirely possible the developers are simply doing it wrong.
     
    Ryiah and angrypenguin like this.
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,900
    Even the folder-structure for assets isn't enforced on the asset store, so why do you expect the resource folder usage to be enforced? :D
    If you can't fix an asset from the asset store when you need it, you should not buy it.

    (You really should not use the resource folder BTW)
     
    Ryiah, Kiwasi and angrypenguin like this.
  4. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,732
    I wish they'd start enforcing some amount of folder standards. I'm actually very close to writing my own dialogue system, shader editor, and input manager because those assets always end up in my projects.
     
    Ryiah, pcg and Kiwasi like this.
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,526
    Some of the more professional assets tend to adhere to these folder standards. Those standards may change as more assets start using assembly definitions and drop support for older Unity versions that don't support assembly definitions.

    There are reasons for using the Resources folder. If an asset absolutely requires the ability to load an asset at runtime, it makes no sense to add the extra complexity of assetbundles. But I'll grant that this is a rare case. In most cases, Resources folders are abused.
     
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,504
    To me this used to be the one reason to use the Resources folder. Now there's Addressable Assets, which should solve that.

    The sucky thing is that Unity told people to stop using it long before they provided solutions for all use cases it covered. That left quite a few Asset Store vendors in sticky positions which I really don't envy. Plus, as TonyLi points out, if your asset is supporting old versions of Unity the new solutions can't be used anyway.

    That said, there are definitely cases where Resources folders just aren't used appropriately. Don't assume that something is a good practice just because it's on the Asset Store.
     
    Ryiah, Kiwasi and TonyLi like this.