Version: Unity 6.2 Alpha (6000.2)
Language : English
Creating custom packages
Package layout

Naming your package

There are two names for a package. The first name is the official name, which is an identifier that you register the package with. The second name is the user-facing display name that appears in the Unity Editor.

Keep the display name brief, yet informative enough so that users can tell what it contains. The Unity Package Manager doesn’t impose any restrictions on the display name.

Guidelines and restrictions for the official name

The official name must conform to the following guidelines and restrictions:

  • The name must use reverse domain name notation, which means it must start with <domain-name-extension>.<company-name>, such as com.example or net.example. This restriction applies even if your company or website name begins with a digit. Following this naming convention prevents name collisions between packages from separate companies.
  • Don’t use com.unity at the beginning of your own package names.
  • Don’t use unity anywhere in your package name.
  • The name can contain only lowercase letters, digits, hyphens(-), underscores (_), and periods (.)
  • The recommended name length is 50 or fewer characters. The Unity Package Manager imposes a strict limit of 214 characters.
  • To indicate nested namespaces, suffix the namespace with an additional period followed by an identifier.

Note: These naming restrictions apply only to the package names themselves and don’t need to match the namespace in your code. For example, you can use Project3dBase as a namespace in a package called net.example.3d.base.

Examples

  • com.company.input
  • com.company.2d.physics
  • com.company.2d.tools

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答
Creating custom packages
Package layout
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961