new-unity-project

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

New Unity Project

新建Unity项目

A guided flow from an idea to a running, version-controlled Unity project. This skill owns the flow — the questions, their ordering, running slow installs in the background while you ask, and the handoffs. It deliberately does not re-document commands; it delegates the mechanics to other skills.
Delegates to (read these for the actual commands — don't reinvent them):
  • unity-cli
    — CLI install, auth/license, Editor install, project creation, source control, opening the project. Its "Bootstrap a new project from scratch" workflow is the backbone here.
  • unity-package-management
    — installing packages via the C# PackageManager Client API, and choosing packages by genre / platform / monetization.
  • implement-in-app-purchases
    ,
    levelplay-unity-integration
    ,
    build-live-game
    — monetization / backend integration (invoked at the end).
Work one step at a time. Ask only the current step's questions and wait for the user before moving on — platform and monetization answers change what you install, so don't gather everything up front or scaffold before they're settled.
这是一个从想法到可运行且已配置版本控制的Unity项目的引导式流程。本技能负责流程管控——包括提问、问题排序、在提问时后台运行耗时的安装操作,以及任务交接。它刻意不重复记录命令,而是将具体操作委托给其他技能。
委托给以下技能(如需了解实际命令请查阅这些技能,不要重复造轮子):
  • unity-cli
    ——CLI安装、授权/许可证、Editor安装、项目创建、版本控制、打开项目。其“从零开始搭建新项目基础架构”的工作流是本流程的核心。
  • unity-package-management
    ——通过C# PackageManager Client API安装包,以及根据游戏类型/平台/变现方式选择合适的包。
  • implement-in-app-purchases
    levelplay-unity-integration
    build-live-game
    ——变现/后端集成(在流程末尾调用)。
逐步推进工作。每次只询问当前步骤的问题,等待用户回答后再进入下一步——平台和变现方式的选择会影响安装内容,因此不要提前收集所有信息,也不要在用户确认前进行搭建。

The flow — and where the parallelism is

流程及并行操作时机

  1. Concept — what they're building.
  2. Platforms & monetization — then, as soon as platforms are known, kick off the Editor install in the background (it takes minutes) and keep talking.
  3. (joins) Editor + platform modules finish installing.
  4. Project + source control — create from a matching template; init git.
  5. Packages — install via the C# Client API.
  6. Save & first commit.
  7. Hand off monetization / backend.
The whole point of a guided flow over a raw recipe: the multi-minute Editor install overlaps the minutes the user spends answering concept questions, so setup feels instant.
  1. 项目概念——用户要开发的内容。
  2. 平台与变现方式——一旦确定目标平台,立即后台启动Editor安装(该过程需数分钟),同时继续与用户交流。
  3. **(同步)**Editor及平台模块安装完成。
  4. 项目与版本控制——从匹配的模板创建项目;初始化git。
  5. 安装包——通过C# Client API安装。
  6. 保存并提交首次版本
  7. 交接——将变现/后端工作移交出去。
与直接提供操作指南相比,引导式流程的核心优势在于:耗时数分钟的Editor安装可以与用户回答项目概念问题的时间重叠,让项目初始化看起来几乎是即时完成的。

Step 1 — Concept

步骤1:项目概念

Use
AskUserQuestion
so the user can pick fast, but let them answer freely too. Cover:
  • Genre / core loop — platformer, top-down shooter, puzzle, idle, RPG, racing, card, tower defense, sim, hyper-casual, first-person, etc.
  • Dimension & look — 2D or 3D; art style (pixel, low-poly, stylized, realistic, UI-only).
  • Gameplay — the one-sentence "what the player does moment to moment."
  • Scope — single-screen prototype vs. multi-scene game; single-player or multiplayer.
Also settle on a project name. Write a 2–4 line project brief, read it back to confirm. The brief drives template choice (Step 4) and packages (Step 5).
使用
AskUserQuestion
让用户快速选择,同时允许自由回答。需涵盖:
  • 游戏类型/核心循环——平台跳跃、俯视角射击、解谜、放置、RPG、竞速、卡牌、塔防、模拟、超休闲、第一人称等。
  • 维度与视觉风格——2D或3D;美术风格(像素风、低多边形、卡通风格、写实风格、仅UI)。
  • 游戏玩法——用一句话描述玩家每时每刻的操作内容。
  • 项目规模——单屏原型还是多场景游戏;单人还是多人。
同时确定项目名称。撰写2-4行的项目简介,并向用户确认。该简介将用于步骤4的模板选择和步骤5的包安装。

Step 2 — Platforms & monetization, then start installing

步骤2:平台与变现方式,随后启动安装

Two decisions, because both change what you install:
  • Target platforms (multi-select): Desktop (Win/macOS/Linux), Mobile (iOS/Android), WebGL, Console. These map to Editor modules (Step 3) and argue for leaner packages on mobile/WebGL.
  • Monetization: none / premium / in-app purchases / ads / mix. This only decides which handoff skill you invoke in Step 7 — don't integrate it now.
Confirm the Editor version to use (default: latest LTS — see
unity-cli
for the LTS vs. Tech vs. beta trade-off). Ask this now, before kicking off the install, so you don't install the wrong one.
Then confirm prerequisites and launch the Editor install as a background task so it runs while you continue. See the
unity-cli
skill for exact syntax, module names per platform, and auth / license setup:
bash
unity --version
unity auth status --format json      # if signed out:  unity auth login
unity license status --format json   # if none active: unity license activate
两个关键决策,因为它们会影响安装内容:
  • 目标平台(可多选):桌面端(Win/macOS/Linux)、移动端(iOS/Android)、WebGL、主机平台。这些对应Editor的模块(步骤3),且移动端/WebGL平台会倾向于选择更轻量化的包。
  • 变现方式:无/付费/内购/广告/混合模式。这仅决定步骤7中调用哪个交接技能——不要在此阶段进行集成。
确认要使用的Editor版本(默认:最新LTS版本——关于LTS、Tech版和测试版的区别请查阅
unity-cli
)。在启动安装前询问此问题,避免安装错误版本。
然后确认前置条件,将Editor安装作为后台任务启动,以便在继续交流的同时进行安装。具体语法、各平台对应的模块名称以及授权/许可证设置请查阅
unity-cli
技能:
bash
unity --version
unity auth status --format json      # 若未登录:unity auth login
unity license status --format json   # 若无有效许可证:unity license activate

Start in the BACKGROUND, then go straight back to the conversation. Module names per platform

在后台启动安装,然后立即回到对话。各平台对应的模块名称(android / ios / webgl / …)可在unity-cli技能中找到。

(android / ios / webgl / …) are in the unity-cli skill.

unity install lts --module <platform-modules> --yes --accept-eula

Run that install as a **background task** (don't block on it). If you have nothing left to ask,
it's fine to just wait — the parallelism only helps when there's a conversation to overlap.
unity install lts --module <platform-modules> --yes --accept-eula

将该安装作为**后台任务**运行(不要阻塞对话)。如果没有剩余问题需要询问,等待即可——并行操作仅在有对话可重叠时发挥作用。

Step 3 — Join: Editor ready

步骤3:同步:Editor准备就绪

Before creating the project, confirm the background install finished:
bash
unity editors --installed --format json
If it failed, surface the error (see
unity-cli
troubleshooting) and stop — nothing downstream works without an Editor.
在创建项目前,确认后台安装已完成:
bash
unity editors --installed --format json
如果安装失败,显示错误信息(请查阅
unity-cli
的故障排除内容)并停止流程——没有Editor,后续所有操作都无法进行。

Step 4 — Create the project + source control

步骤4:创建项目并配置版本控制

Follow the
unity-cli
"Bootstrap a new project from scratch" workflow verbatim:
  • List the real template ids the Editor offers (
    unity templates list
    ) and pick one matching 2D/3D and render pipeline from the brief — don't guess ids.
  • Create with
    unity projects create "<Name>" --path <dir> --editor-version <v> --template <id>
    .
  • Set up source control — ask the user which they want, don't assume: Git (GitHub / GitLab; add
    --git-lfs
    for asset-heavy games) or Unity Version Control (
    --vcs uvcs
    , which handles large binary assets natively — no LFS), or a purely local
    git init
    + Unity
    .gitignore
    . Publish in one step with
    unity projects create --vcs … --git-token-stdin --no-initial-commit
    (tokens on stdin). Pass
    --no-initial-commit
    so the CLI doesn't commit the bare project before packages and
    .meta
    files exist — you make the real first commit/check-in in Step 6. See the
    unity-cli
    workflow for exact flags.
严格遵循**
unity-cli
**的“从零开始搭建新项目基础架构”工作流:
  • 列出Editor提供的真实模板ID
    unity templates list
    ),选择与项目简介中的2D/3D和渲染管线匹配的模板——不要猜测ID。
  • 使用
    unity projects create "<Name>" --path <dir> --editor-version <v> --template <id>
    创建项目。
  • 配置版本控制——询问用户偏好,不要自行假设:Git(GitHub / GitLab;对于资产较多的游戏添加
    --git-lfs
    )或Unity Version Control
    --vcs uvcs
    ,原生支持大型二进制资产——无需LFS),或纯本地的
    git init
    + Unity
    .gitignore
    。 使用
    unity projects create --vcs … --git-token-stdin --no-initial-commit
    一步完成发布(令牌通过标准输入传递)。添加**
    --no-initial-commit
    **参数,避免CLI在包和
    .meta
    文件生成前提交空项目——步骤6中再进行首次提交/检入。具体参数请查阅
    unity-cli
    工作流。

Step 5 — Packages

步骤5:安装包

Map the brief to a concrete package list and install it via the
unity-package-management
skill (C# PackageManager Client API — never hand-edit
manifest.json
). Read that skill for the genre/platform/monetization → package mapping, the installer script, and the
-quit
gotcha. Read the final list back to the user before installing; verify
manifest.json
afterward.
将项目简介映射为具体的包列表,并通过**
unity-package-management
**技能安装(使用C# PackageManager Client API——绝对不要手动编辑
manifest.json
)。游戏类型/平台/变现方式到包的映射、安装脚本以及
-quit
注意事项请查阅该技能。安装前向用户确认最终的包列表;安装后验证
manifest.json

Step 6 — Save & first commit

步骤6:保存并提交首次版本

Open the project once so Unity imports the assets and generates every
.meta
file, then make the first commit with whichever VCS you set up in Step 4:
bash
unity open "<project-path>"     # imports + generates .meta; for headless/CI use the
                                # "Import & save headlessly" method in unity-package-management
  • Git (GitHub / GitLab / local):
    bash
    cd "<project-path>"
    git add -A
    git status                    # Library/ Temp/ obj/ Build/ must NOT be staged
    git commit -m "Initial Unity project: <Name>"
    Every
    .cs
    /asset must be committed together with its
    .meta
    .
  • Unity Version Control (UVCS): check in through your UVCS client/workspace (created during Step 4) — there's no
    git
    step. Generated folders are still excluded by the ignore rules.
If you published via
--vcs
in Step 4 without
--no-initial-commit
, the CLI already made an initial commit of the bare project — add a follow-up commit here rather than double-committing.
打开项目一次,让Unity导入资产并生成所有
.meta
文件,然后使用步骤4中配置的版本控制系统进行首次提交
bash
unity open "<project-path>"     # 导入资产并生成.meta;在无头/CI环境中使用unity-package-management中的“无头模式下导入并保存”方法
  • Git(GitHub / GitLab / 本地):
    bash
    cd "<project-path>"
    git add -A
    git status                    # Library/ Temp/ obj/ Build/ 绝对不能被暂存
    git commit -m "Initial Unity project: <Name>"
    每个
    .cs
    文件/资产必须与其对应的
    .meta
    文件一起提交。
  • **Unity Version Control (UVCS):**通过UVCS客户端/工作区(步骤4中创建)进行检入——无需执行
    git
    步骤。生成的文件夹仍会被忽略规则排除。
如果在步骤4中使用
--vcs
参数发布时未添加
--no-initial-commit
,CLI已提交了空项目的初始版本——在此处添加后续提交即可,不要重复提交。

Step 7 — Hand off

步骤7:任务交接

Based on Step 2 monetization, invoke the matching skill for the actual integration:
  • IAP → implement-in-app-purchases
  • Ads → levelplay-unity-integration
  • Accounts / cloud save / economy / remote config / leaderboards → build-live-game
Report the project path, Editor version, installed packages, and next steps.
根据步骤2中选择的变现方式,调用对应的技能进行实际集成:
  • 内购 → implement-in-app-purchases
  • 广告 → levelplay-unity-integration
  • 账号/云存档/经济系统/远程配置/排行榜 → build-live-game
向用户报告项目路径、Editor版本、已安装的包以及下一步操作。

Scope — what this skill does NOT do

范围:本技能不负责的内容

  • No gameplay scaffolding. It gets you to a running, empty-but-wired project; building the actual game (scenes, controllers, art) is the next conversation — iterate there with the Editor via the
    unity-cli
    MCP server and the Package Manager. Generic genre skeletons tend to produce throwaway mocked primitives, so this skill intentionally stops at a clean starting point.
  • No command reference. Syntax lives in
    unity-cli
    /
    unity-package-management
    .
  • 不搭建游戏玩法。本技能仅帮助你创建一个可运行、已配置好但无内容的项目;实际开发游戏(场景、控制器、美术)是下一个环节——可通过
    unity-cli
    MCP服务器和Package Manager在Editor中迭代开发。通用的游戏类型框架往往会生成一次性的模拟原型,因此本技能特意在干净的起点处停止。
  • 不提供命令参考。命令语法请查阅
    unity-cli
    /
    unity-package-management

Checklist

检查清单

  • Concept brief captured and confirmed (genre, look, gameplay, scope, name)
  • Platforms + monetization recorded; Editor version chosen
  • Editor + platform modules installed (started in the background during Step 2)
  • Project created from a matching template; git initialized with a Unity
    .gitignore
  • Packages installed via the C# Client API;
    manifest.json
    verified
  • Project opened/saved so
    .meta
    files exist; first commit made;
    Library/
    excluded
  • Handed off to the monetization/backend skill if applicable
  • 已捕获并确认项目简介(游戏类型、视觉风格、玩法、规模、名称)
  • 已记录平台+变现方式;已选择Editor版本
  • Editor及平台模块已安装(步骤2中后台启动)
  • 已从匹配模板创建项目;已初始化git并配置Unity
    .gitignore
  • 已通过C# Client API安装包;已验证
    manifest.json
  • 已打开/保存项目以生成
    .meta
    文件;已完成首次提交;已排除
    Library/
  • 若适用,已将任务移交至变现/后端技能

Common mistakes

常见错误

  • Blocking on the Editor install instead of backgrounding it while you ask questions.
  • Installing the wrong Editor because the version wasn't confirmed before the background install.
  • Gathering all questions up front — platform/monetization answers change the modules and packages.
  • Hand-editing
    manifest.json
    instead of using the Client API (see
    unity-package-management
    ).
  • Committing
    Library/
    /
    Temp/
    /
    obj/
    /
    Build/
    , or scripts without their
    .meta
    files.
  • Missing Editor modules — a mobile target needs
    android
    /
    ios
    ; WebGL needs
    webgl
    .
  • 等待Editor安装完成而非在提问时后台运行安装。
  • 安装错误的Editor版本,因为在后台安装前未确认版本。
  • 提前收集所有问题——平台/变现方式的选择会影响模块和包的安装。
  • **手动编辑
    manifest.json
    **而非使用Client API(请查阅
    unity-package-management
    )。
  • 提交
    Library/
    /
    Temp/
    /
    obj/
    /
    Build/
    ,或未提交脚本对应的
    .meta
    文件。
  • 缺少Editor模块——移动端目标需要
    android
    /
    ios
    模块;WebGL需要
    webgl
    模块。