Hi all,
I added ASMDEF to my asset packages. And they worked well.
But then I tried to add ASMDEF to my scripts folder and it gave tones of errors (lack of reference I think) and I couldn’t.
Could you tell me what should I do?
We can’t tell you what to fix if you don’t provide the errors. You’re probably correct that you need to add references to other assembly definitions though. Any Editor scripts will always need their own assembly definition, even if they’re inside another one.
just to add, I separated every individual script (for every package) to 2 folders (editor and other) and made ASMDEF files for each (as we have to)
You’re gonna have to give us a lot more details for us to help you, like screenshots and actual errors you’re receiving. Otherwise we can only provide generic information that may or may not apply to you.
When you start adding assembly definitions, you’re essentially compartmentalizing your code. Code packed inside an assembly won’t know about code outside that assembly unless you add the reference. You have to organize things in a smart way, then, as you can’t have circular dependencies (because then what’s the point, right?) and to get the most out of packing things up like this, you should only be adding references to other assemblies as needed.
I wish Id know what to say as detail.
Start with that. ![]()
Actually a simple approach could also solve my problem. Can I reference scripts instead of ASMDEF files?
Can you share some screenshots of the errors you are receiving, and what you’ve tried? This may help https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html
Sorry for taking your time when I added all the references (it wasn’t easy to find all of the reference ASMDEF files though, especially package ones) it worked.
But still no matter what I do I can not reduce compiling time under 20 seconds. Is there any thing I should do now?
20 seconds would be considered fast. What problem are you trying to solve? So you are no longer receiving errors?
the only problem I have now is 25 seconds. I believe it could be faster…
A fast SSD drive would help. So it slows down compilation only when you add assembly definitions? How long does it take without them?
I have SSD, without ASMDEFs over 30 sec.
Got it, I’m glad you got it sorted.