How and Why Assembly Definitions | Unity Tutorial

Sdílet
Vložit
  • čas přidán 14. 05. 2024
  • In this tutorial we explain: why and how we can use Assembly Definitions in Unity to organize and speed up the compile time in Unity Engine.
    This is the Unity Manual for Asembly Definitions
    docs.unity3d.com/2023.2/Docum...
    If you have more questions i am every weekend live on Twitch at / philberex
    This is MechaNest:
    store.steampowered.com/app/15...
    This is Stream Slugger for Twitch streamers:
    store.steampowered.com/app/22...

Komentáře • 6

  • @chexparty3074
    @chexparty3074 Před měsícem +1

    I agree that one of the biggest reason to use assembly definitions at all is to separate your project scripts from external libraries such as editor-only scripts, asset store packs. By default, Unity does this with any scripts you put in ANY folders named "Editor" (assuming that folder is not part of a custom AssemblyDefinition). Unity will separate them in two assemblies: "Assembly-CSharp" and "Assembly-CSharp-Editor". For Asset store packs, Unity does NOT separate them for you, you have to make sure the asset pack developer put their own AssemblyDefinition file structure, OR you must add one to their pack yourself (and then reference it to your own). It's confusing, but complexity just means freedom. (Also note that you can see what script belongs to what assembly by clicking on the script file in unity and looking at the Inspector window)

  • @sammedia3d
    @sammedia3d Před měsícem +1

    Hey Phil how are you? Nice to see you even doing vids now¨!!!! Looks great!

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

      Doing great Sam, sharing what I have learned so far in Unity Engine 😊

  • @Director414
    @Director414 Před 18 dny +1

    Great tutorial, many thanks! I wish you could go more in depth on how and when to use it. You touched upon it in the end of the video, but I feel this is the main point of assembly definitions - how/when/when not to use it. I don't want to make my project worse instead of better and faster. Cheers!

    • @philberex
      @philberex  Před 18 dny +1

      Hi Eric, thank you for your reaction. While I am building my own apps I will see how I can optimize the use of the assembly definitions and make a video about it. What I certainly know is that don’t try to implement them deeply in an existing project. You gonna have a hard time. Maybe only on the root of your scripts folder 😉

    • @Director414
      @Director414 Před 17 dny +1

      @@philberex thanks for your reply. I made one for all asset store downloads and only that sped up my compilation time 5x at least. Totally awesome!!