For AI agents: the complete documentation index is available at /AchEngine/zh/llms.txt, the full documentation bundle is available at /AchEngine/zh/llms-full.txt, and this page is available as Markdown at /AchEngine/zh/usage/localization/codegen.md.
  • 简体中文
  • 键常量代码生成

    可以根据点号分隔的键生成嵌套静态类。

    {
      "menu.start": "开始",
      "item.sword.name": "铁剑"
    }
    L.Menu.Start
    L.Item.Sword.Name

    在 LocalizationSettings 中配置 generatedClassName、generatedNamespace、generatedOutputPath 和数据库,然后执行 AchEngine › Localization › Generate Key Class。

    使用 LocalizedString 字段可以在 Inspector 中通过下拉框选择键。

    [LocalizedString]
    [SerializeField] private LocalizedString _title;