Unity Tutorial: Understanding Assemblies
Vložit
- čas přidán 7. 07. 2024
- In this tutorial we're going to take a look in depth at using Assembly Definitions in Unity to organise our project and to reduce our compile times.
🎞️ Chapters
00:00 Introduction
05:30 Creating an assembly definition
08:45 Adding references to other assemblies
12:30 Creating an editor assembly
17:50 Creating version defines
26:00 Setting up constraints
30:15 Using sub-assemblies
📂 Grab the full project ➠ github.com/GameDevEducation/U...
If you've got questions add a comment below or send them in for the next Q&A video
🤔 Send in your questions ➠ forms.gle/ToyvqPaBFvpFLtNbA
📁 The searchable video archive is at ➠ www.iainmcmanus.dev/gamedev-e...
Looking for other ways to get involved?
🟠 Support the channel on Patreon ➠ / iaintheindie
🟡 Get the code for all the projects on GitHub ➠ github.com/orgs/GameDevEducation
🟢 Check out my games on itch.io ➠ iaintheindie.itch.io/
🟣 Follow me on Twitter ➠ / iaintheindie
🎉 Thankyou to all of the Patrons 🎉
➔ Grant Coble-Neal
➔ John Douglas
➔ Kasper Enwall
➔ Adam Ercanbrack
➔ Tylah Heil
➔ Ian Kehoe
➔ James McCarthy
➔ Kalvin Pearce
➔ Seriphis
➔ Bradley Seymour
➔ SiliconOrchid
➔ Brian Smith
➔ Callan Syratt
➔ Robert Thorpe
➔ Daniel Williams
#Unity #Tutorial #GameDev
Great to see you back, Iain! Hope you're doing well :)
Great work! This video is just what i needed.
Thankyou! Awesome to hear it helped :)
Thanks for sharing your knowledge with us Iain! I'm a mid-level programmer and I've been learning a lot with your videos.
good to see you again i hope everythings okay
Criminally underrated. Recently I've been decompiling Unity projects and looking through with ILspy and DLspy to see under the hood of things.
I'm not a program; more so an artist but trying to read a book or watch tutorial on C# or Unity I get so sleepy. But the more indepth nuances I find is more interesting.
That is one big advantage with .net based things like Unity, they can be disassembled into something quite usable. It's let folks do things like create mods for single player games to add multiplayer support.
I love your tutorials because they always teach my stuff I didn’t even know existed and therefore wasn’t searching for. I’ve learnt more from you than I have most of my university professors. Hope you are on the mend too mate, your looking well
Such a great video!! The clearest I've seen so far on assemblies - I finally understand them!
One question...will assemblies automatically recompile if other assemblies that they're dependent on are recompiled?
Thankyou! That's a great question. My understanding is yes if necessary but I haven't heavily stress tested it.
Heyyyy!!! glad to you're back already. Hope you're doing well.
I want to use assembly definitions from the start in my latest project, to make sure the project stays reasonably snappy.
I got it working up until I utilized my custom attributes. Here everything works in the inspector, since the attributes reference editor code I have to make another asm def for them only included in the editor.
This works great in editor, but when I start building my project I get errors that the custom attribute namespaces cannot be found. When I enable the asm def for all platforms I get errors that the custom attributes reference editor code, not allowing me to build.
If it's only failing on build then you can likely work around that by wrapping any of the editor only sections with:
#if UNITY_EDITOR
... editor code here ...
#endif // UNITY_EDITOR
hi Ian , nice video, what about where scripts need to reference each other and these are in different assemblies, what would be the solution to avoid circular reference? especially in an existing project.
There's not a great way around that which I've seen. Depending on the setup it might be an option to have a child class in one assembly that has a parent in a different assembly. I've done that for analytics before. In general I've used a mix of inheritance and events to avoid circular references.
Modular
I tried to improve your code that all