Version: 2020.2
Versioning
Meeting legal requirements

Assembly definition and packages

You must associate scripts inside a package to an assembly definition file (.asmdef). Assembly definition files are the Unity equivalent to a C# project in the .NET ecosystem. You must set explicit references in the assembly definition file to other assemblies (whether in the same package or in external packages). See Assembly Definitions for more details.

Use these conventions for naming and storing your assembly definition files to ensure that the compiled assembly filenames follow the .NET Framework Design Guidelines:

  • Store Editor-specific code under a root editor assembly definition file:

    Editor/MyCompany.MyFeature.Editor.asmdef

  • Store runtime-specific code under a root runtime assembly definition file:

    Runtime/MyCompany.MyFeature.Runtime.asmdef

  • Configure related test assemblies for your editor and runtime scripts:

    Tests/Editor/MyCompany.MyFeature.Editor.Tests.asmdef

    Tests/Runtime/MyCompany.MyFeature.Runtime.Tests.asmdef

To get a more general view of a recommended package folder layout, see Package layout.


Versioning
Meeting legal requirements
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961