Unity Tutorial: Understanding Assemblies

Sdílet
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

Komentáře • 18

  • @tooloo3658
    @tooloo3658 Před rokem +6

    Great to see you back, Iain! Hope you're doing well :)

  •  Před měsícem +1

    Great work! This video is just what i needed.

    • @IainTheIndie
      @IainTheIndie  Před měsícem

      Thankyou! Awesome to hear it helped :)

  • @carlinhu4330
    @carlinhu4330 Před rokem +4

    Thanks for sharing your knowledge with us Iain! I'm a mid-level programmer and I've been learning a lot with your videos.

  • @vazquelol3097
    @vazquelol3097 Před rokem

    good to see you again i hope everythings okay

  • @freezingcicada6852
    @freezingcicada6852 Před rokem +1

    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.

    • @IainTheIndie
      @IainTheIndie  Před rokem +1

      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.

  • @scruff-duff
    @scruff-duff Před rokem

    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

  • @GregX999
    @GregX999 Před rokem +1

    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?

    • @IainTheIndie
      @IainTheIndie  Před rokem

      Thankyou! That's a great question. My understanding is yes if necessary but I haven't heavily stress tested it.

  • @therebelliousgeek4506

    Heyyyy!!! glad to you're back already. Hope you're doing well.

  • @TechDunk
    @TechDunk Před 11 měsíci +1

    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.

    • @IainTheIndie
      @IainTheIndie  Před 11 měsíci

      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

  • @davidbone2295
    @davidbone2295 Před rokem +1

    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.

    • @IainTheIndie
      @IainTheIndie  Před rokem

      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.

  • @mohokhachai
    @mohokhachai Před 9 měsíci

    Modular

  • @mohokhachai
    @mohokhachai Před 9 měsíci

    I tried to improve your code that all