Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

How to create an assembly definition file

Discussion in '2017.2 Beta' started by bpeake, Jul 7, 2017.

  1. bpeake

    bpeake

    Joined:
    Apr 8, 2013
    Posts:
    22
    I just downloaded 2017.2b and can't seem to find how to create an assembly definition file. I've tried on both mac and windows editors and don't see any option for it. Has anyone else had luck setting this up?
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
  3. bpeake

    bpeake

    Joined:
    Apr 8, 2013
    Posts:
    22
    Oh that works perfectly, thanks!
     
  4. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    74
    Is the reference to another assembly.json file necessary if you have two or more assembly files?
     
  5. bpeake

    bpeake

    Joined:
    Apr 8, 2013
    Posts:
    22
    It depends on if you are using code from those assemblies. If they do not have any dependencies then no reference is needed.
     
  6. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Do you have to create this file manually? Is there a way to create it from the editor GUI?
     
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    No, there is no specific editor GUI to create Assembly Definition Files yet.
     
  8. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Ok, I guess they're pretty easy to create from scratch.
     
  9. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    The UI for this feature is still in development and expected to land after summer. For now you have to create them manually.
     
  10. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Ok. What is the UI going to look like?
     
  11. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    I usually like UI but when dealing with code, staying in code seems better.
    Why didn't you guys chose one assembly per namespace? Maybe with an attribute [SeparateAssembly] to avoid breakage.
     
  12. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,053
    But manually defined files are going to still be there isn't it? It's critical for asset store publishers or to reuse existing code between projects. Because I assume that the proposed UI it's going to store that info in a ProjectSettings folder file.

    I think that an UI for this isn't really useful because to generate an assembly you need to know to code and if you know that you don't mind to create manually a file that you only need to create or edit a few times in the project lifecycle.
     
    laurentlavigne likes this.
  13. lukaszunity

    lukaszunity

    Administrator

    Joined:
    Jun 11, 2014
    Posts:
    461
    The inspector will still use the files to store the assembly definition information. The only change that will happen when the inspector lands is that the assembly definition files extension will change from .assembly.json to .asmdef.

    More info here: https://forum.unity3d.com/threads/example-project-assembly-definition-files.482313/