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. | |
General | ||
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 | これを有効にすると、Unity はアセンブリをコンパイルする際に、UnityEditor や UnityEngine への参照を加えません。 | |
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:!ENABLE_IL2CPP UNITY_2018_3_OR_NEWER 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 | アセンブリのプラットフォーム互換性を設定します。Unity は、含まれる (または除外されない) プラットフォーム上でのみ、このアセンブリをコンパイルまたは参照します。 | |
Version Defines | Specify which versions of a package and modules to include in compilations. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.