Version: 2019.3
Assembly Definitions

Assembly Definition properties

Click on an Assembly Definition Asset to set the properties for an assembly in the Inspector window.

Assembly Definition Inspector
Assembly Definition Inspector
プロパティー 説明
Name The name for the assembly (without a file extension). Assembly names must be unique across the Project. Consider using a reverse-DNS naming style, especially if you want to use the assembly in more than one Project. Note: Unity uses the name you assign to the Assembly Definition Asset as the default value of the Name field, but you can change the name as desired.
Allow ‘unsafe’ code Enable the Allow ‘unsafe’ Code option if you have used the C# /unsafe keyword in a script within the assembly. When you enable this setting, Unity passes the /unsafe option to the C# compiler when it compiles the assembly.
Auto Referenced Specify whether all predefined assemblies should reference this Project assembly. When you enable this property, the predefined assemblies reference all assemblies defined in the Project, which matches how predefined assemblies reference precompiled assemblies (plug-ins).

When you disable the Auto Reference setting on a file, Unity does not automatically reference the file during compilation. This has no effect on whether Unity includes it in the build. You can control the Build Settings for plug-ins in Platform Settings.
Override References Enable the Override References setting to manually specify which precompiled assemblies this assembly depends upon. When you enable Override References, the Inspector shows the Assembly References section, which you can use to specify the references.

A precompiled assembly is a library compiled outside your Unity Project. By default, assemblies you define in your Project reference all the precompiled assemblies you add to the Project, which matches how the predefined assemblies reference all precompiled assemblies. When you enable Override References, this assembly only references the precompiled assemblies you add under Assembly References.

Note: To prevent Project assemblies from automatically referencing a precompiled assembly, you can disable its Auto Referenced option. See Plugin Inspector for more information.
No Engine References When you enable this property, Unity does not add references to UnityEditor or UnityEngine when it compiles the assembly.
Define Constraints Specify the compiler #define directives that must be defined in order for an assembly to be compiled or referenced.

Unity only compiles and references a Project assembly if all the Define Constraints are satisfied. Constraints work like the #if preprocessor directive in C#, but on the assembly level instead of the script level. You must define all the symbols in the Define Constraints setting for the constraints to be satisfied. To specify that a symbol must be undefined, prefix it with a negating ! (bang) symbol. For example, if you specify the following symbols as your Define Constraints:


The constraints are satisfied when the symbol ENABLE_IL2CPP is not defined and the symbol UNITY_2018_3_OR_NEWER is defined. Or to put it differently, this assembly is only compiled and referenced on non-IL2CPP scripting runtimes for Unity 2018.3 or newer.

You can use any of Unity’s built-in #define directives or any symbols defined in the Project’s Scripting Define Symbols Player setting. See Platform dependent compilation for more information, including a list of the built-in symbols. Note that the Scripting Define Symbols settings are platform-specific. If you use this setting to define whether an assembly is used, make sure that you define the necessary symbols on all the relevant platforms.
Assembly Definition References Specify references to other assemblies that you have created using Assembly Definition Assets.

Unity uses these references to compile the assembly and also define the dependencies between assemblies.
Use GUIDs This setting controls how Unity serializes references to other Assembly Definition Assets. When you enable this property, Unity saves the reference as the Asset’s GUID, instead of the Assembly Definition name. It’s good practice to use the GUID instead of the name, because it means you can make changes to the name of an Assembly Definition Asset without having to update other Assembly Definition files that reference it.
Assembly References Only appears if you enable the Override References property. Use this area to specify any references to precompiled assemblies on which this assembly depends.
Platforms Set the platform compatibility of the assembly. Unity only compiles or references this assembly on the included (or not excluded) platforms.
Version Defines Specify which versions of a package and modules to include in compilations.
Assembly Definitions