• 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 May 09, 2017 at 11:46 PM by elenzil for the following reason:

Question is off-topic or not relevant

avatar image
0
Question by elenzil · May 09, 2017 at 05:33 PM · collisionresourcescompilefilename

feature request: detect resource filename collisions at compile-time

Using unity 5.4.1, it's cool to have multiple "Resources" folders.

eg,

 foo/Resources/foo.txt
 bar/Resources/bar.txt

and if you do Resources.load("bar"), it works, yay!

however, if there's two resource files w/ the same name, like this:

 foo/Resources/blah.txt
 bar/Resources/blah.txt

then Resources.Load() will choose one of them without any warns or errors.

imo, this situation should be a compile-time error.

Comment
Add comment · Show 1
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 ARKMs · May 10, 2017 at 07:29 PM 0
Share

I made a script that can help with this:

ResourcesCheckConflict.cs

3 Replies

  • Sort: 
avatar image
0

Answer by JustAnotherDude · May 09, 2017 at 10:04 PM

This is not a question, post it on https://feedback.unity3d.com/

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
avatar image
0

Answer by Bunny83 · May 09, 2017 at 10:07 PM

I agree that this can cause some confusion. However i think you still should be able to load both resources with Resources.LoadAll. Resources are not files but just assets. The name of the asset is just another datafield. Like in most databases you can have multiple entries with the same data (unless the column is set to be unique / is a primary key).

Though if you want to make a feature request you should post it on feedback

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 unityBerserker · May 10, 2017 at 06:20 PM 0
Share

A month ago I create a lot of test of Resources class.

If we load assets with method Resources.Load("name") we are loading all assets with that name in resources folder.

We don't care about type of asset. If we have three assets with same name but different types like name.txt, name.prefab and name.mat, next we use Resources.Load("name") we will load those tree assets to memory.

We can filtrate returned result simply by using generic version of Load() method (or with method with second argument.) Even if we use generic version of method Load() it always load all assets with given path/name.

avatar image
0

Answer by elenzil · May 09, 2017 at 11:45 PM

thanks @RafaelF82 and @Bunny83 - moved to feedback here, and closing this.

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

102 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 avatar image avatar image avatar image

Related Questions

Best way use Resources.Load for spcific type? 1 Answer

Failed to recompile resources Facebook sdk integration with admob, unity ads plugin 1 Answer

Loading Resources folder contents in StandAlone Player 1 Answer

OnCollision events inside child with collider 0 Answers

making ray ignor certain collider 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges