Is it okay to put all my unity assets in the folder Asset/Plugins/?

Hi,

When I import an asset from the package manager (Not art assets, just code/tools assets), I put them in a folder called Plugins/ just for organization instead of having everything at the root.

However, I didn’t knew that Unity read it as a special folder so now their assembly definition is Assembly-CSharp-firstpass. I understand that a lot of plugins come with their own asmdef so it doesn’t really change anything, however I do have some plugins with a lot of scripts that doesn’t have their own asmdef, which now put them in the first pass.

I guess it could decrease domain reload times by a very small margin, but could it cause problem since it’s the first pass instead of the default Assembly-CSharp? Should I have instead a Third Party folder with it’s own assembly ?

Thanks!

It‘s okay to do so and if the asset has no asmdef it‘s best practice. The only issue being that the asset may break because it may rely on absolute paths but these are rare and easily fixed.

Whether you use plugins or add an asmdef is merely a matter of preference. Though you will have to do the latter anyway if your code has a dependency on the asset‘s code.

Okay thanks! But is it still okay that the first-pass will compile before the main assembly, so it could do some weird racing conditions between the plugins and the main assembly?

No race condition with assembly definitions. :wink:
Without them, you may not have the namespaces available in code, so that would be obvious too.

1 Like