unity-netcode

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via
GET /skills/recommend?includeSchema=true
) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.
**调用本模块中的任何技能之前:**如果您打算根据技能名称或描述猜测参数来调用技能,请停止——先阅读本文档(或通过
GET /skills/recommend?includeSchema=true
获取其schema)。如果您已经从推荐/schema中获得了参数定义,可以直接进行dryRun。

Triggers

触发场景

  • Scaffolding multiplayer
  • Registering network prefabs
  • Wiring spawn logic
  • Starting host/server/client
  • 搭建多人联机、注册网络预制体、连接生成逻辑、启动 host/server/client
  • 搭建多人联机系统
  • 注册网络预制体
  • 配置生成逻辑
  • 启动host/server/client
  • 搭建多人联机、注册网络预制体、连接生成逻辑、启动 host/server/client

Unity Netcode for GameObjects Skills

Unity Netcode for GameObjects 技能集

Automation for Netcode for GameObjects (NGO) multiplayer setup and operations. Every skill is source-verified against NGO 2.x; when the package is absent, each skill returns a
NoNetcode()
error with install instructions. A subset of skills additionally require NGO 2.5.0+ (see NGO 2.5+ features) — on an older 2.x install they return a structured "requires 2.5.0+" error instead of a compile error, since AttachableBehaviour/AttachableNode/ComponentController are detected by reflection, not by a dedicated version symbol.
Requires:
com.unity.netcode.gameobjects
(2.x), Unity 6000.0+. Strongly recommended: before calling any
netcode_*
skill, load netcode-design. NGO lifecycle and permission rules are strict; skills alone cannot prevent incorrect business code.
Netcode for GameObjects(NGO)多人联机系统搭建与操作的自动化工具。每个技能均针对NGO 2.x进行了源码验证;当缺少该包时,每个技能都会返回
NoNetcode()
错误并附带安装说明。部分技能还需要NGO **2.5.0+**版本(参见NGO 2.5+功能)——在旧版2.x安装环境中,它们会返回结构化的“需要2.5.0+版本”错误,而非编译错误,因为AttachableBehaviour/AttachableNode/ComponentController是通过反射检测的,而非专用版本符号。
依赖要求
com.unity.netcode.gameobjects
(2.x),Unity 6000.0+。 强烈建议:在调用任何
netcode_*
技能之前,加载netcode-design。NGO的生命周期和权限规则非常严格;仅靠技能无法避免错误的业务代码。

Guardrails

防护规则

Operating Mode (v1.9 three-tier):
  • Approval (default): query/list/info skills (
    netcode_check_setup
    ,
    netcode_get_manager_info
    ,
    netcode_get_transport_info
    ,
    netcode_list_network_objects
    ,
    netcode_get_network_object_info
    ,
    netcode_list_network_prefabs
    ,
    netcode_list_network_behaviours
    ,
    netcode_get_spawn_manager_info
    ,
    netcode_get_scene_manager_info
    ,
    netcode_get_status
    ,
    netcode_version
    ,
    netcode_attachable_info
    ) run directly. Mutators (create/configure/attach/add) are FullAuto — on
    MODE_RESTRICTED
    , run the grant protocol.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • Auto-forbidden in this module:
    • SkillOperation.Delete
      netcode_remove_manager
      ,
      netcode_remove_network_object
      ,
      netcode_remove_from_prefabs_list
    • MayTriggerReload = true
      netcode_add_network_behaviour_script
      (writes a new
      .cs
      , forces script compile + Domain Reload)
    • MayEnterPlayMode = true
      netcode_start_host
      ,
      netcode_start_server
      ,
      netcode_start_client
      ,
      netcode_shutdown
    These are reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow returns
    MODE_FORBIDDEN
    . Runtime control + Behaviour-script generation are the practical reason this module is gated.
  • When
    com.unity.netcode.gameobjects
    is missing, every skill returns a
    NoNetcode()
    error with install instructions.
DO NOT (common hallucinations):
  • netcode_spawn_object
    /
    netcode_spawn_player
    — do not exist. Spawn must happen in runtime code (NetworkBehaviour) via
    .Spawn()
    or
    NetworkManager.SpawnManager.InstantiateAndSpawn
    . Skills do not proxy Spawn because Spawn requires a running NetworkManager.
  • netcode_register_scene
    — does not exist. Scene registration goes through Build Settings +
    EnableSceneManagement
    . This module only exposes
    netcode_configure_scene_management
    for reading/writing the config.
  • netcode_set_tick_rate
    /
    netcode_set_protocol
    as standalone skills — do not exist. Use
    netcode_configure_manager
    for all NetworkConfig edits.
  • Do not assume
    netcode_start_host
    works in Edit Mode. All Runtime control skills require PlayMode.
  • Do not assume
    netcode_add_to_prefabs_list
    automatically attaches a
    NetworkObject
    component. Call
    netcode_add_network_object
    first.
Routing:
  • Plain GameObject hierarchy creation →
    gameobject
  • Attach NetworkObject / NetworkTransform / other networking components → this module
  • Generic player-prefab components (Rigidbody / Collider / Animator) →
    component
  • Runtime scene switching (LoadScene) → call
    NetworkManager.SceneManager.LoadScene
    from the generated NetworkBehaviour; this module does not execute it
  • Code-level design decisions (RPC direction, NetworkVariable permission) → netcode-design advisory
操作模式(v1.9 三级模式):
  • 审批模式(默认):查询/列表/信息类技能(
    netcode_check_setup
    netcode_get_manager_info
    netcode_get_transport_info
    netcode_list_network_objects
    netcode_get_network_object_info
    netcode_list_network_prefabs
    netcode_list_network_behaviours
    netcode_get_spawn_manager_info
    netcode_get_scene_manager_info
    netcode_get_status
    netcode_version
    netcode_attachable_info
    )可直接运行。修改类技能(创建/配置/附加/添加)为全自动模式——在
    MODE_RESTRICTED
    模式下,需运行授权流程。
  • 自动模式 / 绕过模式:半自动和全自动技能可直接运行。
  • 本模块中自动禁用的操作:
    • SkillOperation.Delete
      netcode_remove_manager
      netcode_remove_network_object
      netcode_remove_from_prefabs_list
    • MayTriggerReload = true
      netcode_add_network_behaviour_script
      (写入新的
      .cs
      文件,强制脚本编译 + 域重载)
    • MayEnterPlayMode = true
      netcode_start_host
      netcode_start_server
      netcode_start_client
      netcode_shutdown
    这些操作仅在绕过模式下或通过用户管理的白名单条目才能执行;授权流程会返回
    MODE_FORBIDDEN
    错误。运行时控制和行为脚本生成是本模块被限制的实际原因。
  • 当缺少
    com.unity.netcode.gameobjects
    包时,所有技能都会返回
    NoNetcode()
    错误并附带安装说明。
切勿(常见错误用法):
  • netcode_spawn_object
    /
    netcode_spawn_player
    ——不存在这些技能。生成操作必须在运行时代码(NetworkBehaviour)中通过
    .Spawn()
    NetworkManager.SpawnManager.InstantiateAndSpawn
    执行。技能不会代理生成操作,因为生成需要运行中的NetworkManager。
  • netcode_register_scene
    ——不存在该技能。场景注册需通过Build Settings +
    EnableSceneManagement
    完成。本模块仅提供
    netcode_configure_scene_management
    用于读写配置。
  • netcode_set_tick_rate
    /
    netcode_set_protocol
    作为独立技能——不存在这些技能。所有NetworkConfig编辑请使用
    netcode_configure_manager
  • 不要假设
    netcode_start_host
    在编辑模式下可用。所有运行时控制技能都需要进入PlayMode。
  • 不要假设
    netcode_add_to_prefabs_list
    会自动附加
    NetworkObject
    组件。请先调用
    netcode_add_network_object
路由指引
  • 普通GameObject层级创建 → 使用
    gameobject
    模块
  • 附加NetworkObject / NetworkTransform / 其他网络组件 → 使用本模块
  • 通用玩家预制体组件(Rigidbody / Collider / Animator) → 使用
    component
    模块
  • 运行时场景切换(LoadScene) → 从生成的NetworkBehaviour中调用
    NetworkManager.SceneManager.LoadScene
    ;本模块不执行此操作
  • 代码层面的设计决策(RPC方向、NetworkVariable权限) → 参考netcode-design的建议

Object Targeting

对象定位

netcode_add_*
/
netcode_configure_*
skills use the usual target parameters:
  • name
    — scene object name
  • instanceId
    — Unity InstanceID (exact)
  • path
    — hierarchy path
    Parent/Child
Prefer
instanceId
when there is a chance of duplicate names.
netcode_add_*
/
netcode_configure_*
技能使用常规目标参数:
  • name
    —— 场景对象名称
  • instanceId
    —— Unity实例ID(精确匹配)
  • path
    —— 层级路径
    Parent/Child
当存在名称重复的可能时,优先使用
instanceId

Skills

技能列表

Setup & Validation

搭建与验证

SkillPurposeKey Parameters
netcode_check_setup
Verify package, NetworkManager, Transport, PlayerPrefab, and PrefabsList consistency
verbose?
netcode_create_manager
Create NetworkManager + UnityTransport
name?
netcode_configure_manager
Bulk-edit NetworkConfig (TickRate, ConnectionApproval, EnableSceneManagement, NetworkTopology, ...)
name?
, 15+ optional fields
netcode_get_manager_info
Read NetworkConfig + runtime state
name?
netcode_remove_manager
Delete the NetworkManager (must already be Shutdown)
name?
技能用途关键参数
netcode_check_setup
验证包、NetworkManager、传输层、玩家预制体和预制体列表的一致性
verbose?
netcode_create_manager
创建NetworkManager + UnityTransport
name?
netcode_configure_manager
批量编辑NetworkConfig(TickRate、连接审批、场景管理启用、网络拓扑等)
name?
,15+可选字段
netcode_get_manager_info
读取NetworkConfig + 运行时状态
name?
netcode_remove_manager
删除NetworkManager(必须已关闭)
name?

Transport

传输层

SkillPurposeKey Parameters
netcode_set_transport_address
Direct connection: set Address / Port / ServerListenAddress
address
,
port
,
serverListenAddress?
netcode_set_relay_server_data
Relay mode (mutually exclusive with direct connection)
address
,
port
,
allocationIdBase64
,
keyBase64
,
connectionDataBase64
,
hostConnectionDataBase64?
,
isSecure?
netcode_set_debug_simulator
Simulate latency / jitter / packet loss (development only)
packetDelay
,
packetJitter
,
dropRate
netcode_get_transport_info
Read current transport info
name?
技能用途关键参数
netcode_set_transport_address
直接连接:设置地址/端口/服务器监听地址
address
,
port
,
serverListenAddress?
netcode_set_relay_server_data
中继模式(与直接连接互斥)
address
,
port
,
allocationIdBase64
,
keyBase64
,
connectionDataBase64
,
hostConnectionDataBase64?
,
isSecure?
netcode_set_debug_simulator
模拟延迟/抖动/丢包(仅用于开发)
packetDelay
,
packetJitter
,
dropRate
netcode_get_transport_info
读取当前传输层信息
name?

NetworkObject

NetworkObject

SkillPurposeKey Parameters
netcode_add_network_object
Attach NetworkObject to a GameObject
name/instanceId/path
+ NetworkObject fields
netcode_configure_network_object
Modify fields on an existing NetworkObjectsame as above
netcode_remove_network_object
Remove a NetworkObject (must not be currently spawned)same as above
netcode_list_network_objects
List all NetworkObjects in scene (including runtime state)
includeInactive?
netcode_get_network_object_info
Query a single NetworkObject in detailsame as above
技能用途关键参数
netcode_add_network_object
为GameObject附加NetworkObject组件
name/instanceId/path
+ NetworkObject字段
netcode_configure_network_object
修改现有NetworkObject的字段同上
netcode_remove_network_object
移除NetworkObject(当前未生成)同上
netcode_list_network_objects
列出场景中所有NetworkObject(包括运行时状态)
includeInactive?
netcode_get_network_object_info
详细查询单个NetworkObject同上

NetworkPrefabsList

网络预制体列表

SkillPurposeKey Parameters
netcode_create_prefabs_list
Create a NetworkPrefabsList asset
path
,
assignToManager?
netcode_add_to_prefabs_list
Add a prefab (optional override: None/Prefab/Hash)
listPath
,
prefabPath
,
overrideMode?
, ...
netcode_remove_from_prefabs_list
Remove a prefab entry
listPath
,
prefabPath
netcode_list_network_prefabs
List every entry with its hash
listPath
netcode_set_player_prefab
Set
NetworkConfig.PlayerPrefab
prefabPath
,
name?
技能用途关键参数
netcode_create_prefabs_list
创建NetworkPrefabsList资源
path
,
assignToManager?
netcode_add_to_prefabs_list
添加预制体(可选覆盖模式:None/Prefab/Hash)
listPath
,
prefabPath
,
overrideMode?
, ...
netcode_remove_from_prefabs_list
移除预制体条目
listPath
,
prefabPath
netcode_list_network_prefabs
列出所有条目及其哈希值
listPath
netcode_set_player_prefab
设置
NetworkConfig.PlayerPrefab
prefabPath
,
name?

Components

组件

SkillPurposeKey Parameters
netcode_add_network_transform
Attach NetworkTransform with axis sync togglestarget + 15 optional fields
netcode_configure_network_transform
Edit fields / thresholds on an existing NTincludes PositionThreshold etc.
netcode_add_network_rigidbody
Attach NetworkRigidbody / NetworkRigidbody2D
useRigidbody2D?
,
useRigidBodyForMotion?
netcode_add_network_animator
Attach NetworkAnimator (Animator required)target
netcode_add_network_behaviour_script
Generate a NetworkBehaviour script template (OnNetworkSpawn/Despawn + optional RPC/NetworkVariable/Ownership/NGO 2.5+ OnNetworkPreDespawn)
className
,
path
,
includeRpc?
,
includeNetworkVariable?
,
includeOwnershipCallbacks?
,
includePreDespawn?
netcode_list_network_behaviours
List NetworkBehaviour subclass instances in the scene
includeInactive?
技能用途关键参数
netcode_add_network_transform
附加带轴同步开关的NetworkTransform目标对象 + 15+可选字段
netcode_configure_network_transform
编辑现有NT的字段/阈值包含PositionThreshold等
netcode_add_network_rigidbody
附加NetworkRigidbody / NetworkRigidbody2D
useRigidbody2D?
,
useRigidBodyForMotion?
netcode_add_network_animator
附加NetworkAnimator(需要Animator组件)目标对象
netcode_add_network_behaviour_script
生成NetworkBehaviour脚本模板(包含OnNetworkSpawn/Despawn + 可选RPC/NetworkVariable/所有权/NGO 2.5+ OnNetworkPreDespawn)
className
,
path
,
includeRpc?
,
includeNetworkVariable?
,
includeOwnershipCallbacks?
,
includePreDespawn?
netcode_list_network_behaviours
列出场景中NetworkBehaviour子类实例
includeInactive?

Scene & Spawning Query

场景与生成查询

SkillPurpose
netcode_configure_scene_management
Set EnableSceneManagement / LoadSceneTimeOut / ClientSynchronizationMode
netcode_get_spawn_manager_info
Runtime: list SpawnedObjects
netcode_get_scene_manager_info
Runtime: read scene load state
技能用途
netcode_configure_scene_management
设置场景管理启用状态/场景加载超时/客户端同步模式
netcode_get_spawn_manager_info
运行时:列出已生成对象
netcode_get_scene_manager_info
运行时:读取场景加载状态

Runtime Control (PlayMode required)

运行时控制(需进入PlayMode)

SkillPurpose
netcode_start_host
Start Host
netcode_start_server
Start Server
netcode_start_client
Start Client
netcode_shutdown
Shut down (optional
discardMessageQueue
)
netcode_get_status
Read IsHost / IsServer / IsClient, LocalClientId, ConnectedClients, NetworkTime
技能用途
netcode_start_host
启动主机
netcode_start_server
启动服务器
netcode_start_client
启动客户端
netcode_shutdown
关闭(可选
discardMessageQueue
参数)
netcode_get_status
读取IsHost/IsServer/IsClient、LocalClientId、已连接客户端、网络时间

NGO 2.5+ Features {#ngo-25-features}

NGO 2.5+功能 {#ngo-25-features}

Added in Netcode for GameObjects 2.5.0 (verified against the package CHANGELOG, PR #3518):
AttachableBehaviour
/
AttachableNode
are an alternate "attach" parenting system that avoids the classic
NetworkObject
parenting pitfalls;
ComponentController
network-synchronizes the enabled/disabled state of a list of components. On NGO 2.0–2.4.x (
NETCODE_GAMEOBJECTS
is still active, but these types don't exist yet) every skill below returns a structured
requires 2.5.0+
error instead of failing — call
netcode_version
first to confirm.
SkillPurposeKey Parameters
netcode_version
Report installed NGO version and 2.5+ feature availability
netcode_attachable_info
Audit the scene's AttachableBehaviour / AttachableNode / ComponentController distribution
includeInactive?
netcode_attachable_add
Attach an
AttachableBehaviour
to a GameObject nested under a NetworkObject
target +
autoDetach?
(
None
/
OnAttachNodeDestroy
/
OnDespawn
/
OnOwnershipChange
, comma-separated)
netcode_attachable_node_add
Attach an
AttachableNode
(the socket an
AttachableBehaviour
attaches to)
target +
detachOnDespawn?
netcode_component_controller_add
Attach a
ComponentController
to a GameObject
target +
startEnabled?
netcode_component_controller_configure
Set
StartEnabled
and/or populate the synchronized component list from target GameObjects (mirrors dragging a GameObject onto the Components field in the Inspector)
target,
targetPaths?
,
clearExisting?
,
startEnabled?
Notes:
  • AttachableBehaviour
    must live on a child GameObject nested under a
    NetworkObject
    's hierarchy, not directly on the
    NetworkObject
    's own GameObject.
  • AttachableNode
    must belong to a different
    NetworkObject
    than the
    AttachableBehaviour
    instances attaching to it.
  • Attach()
    /
    Detach()
    are runtime-only calls (require both instances spawned) and are intentionally not exposed as skills — same rationale as
    netcode_spawn_object
    not existing (see DO NOT above): the caller must already have a running NetworkManager and do this from NetworkBehaviour code.
  • netcode_component_controller_configure
    's
    targetPaths
    accepts whole GameObjects; NGO's own
    OnValidate()
    (invoked by this skill) expands each into every eligible child component with a public
    bool enabled
    property, skipping
    NetworkBehaviour
    /
    NetworkObject
    /
    NetworkManager
    — identical to what happens when you drag a GameObject onto the Components field in the Inspector.
Netcode for GameObjects 2.5.0版本新增功能(已对照包CHANGELOG、PR #3518验证):
AttachableBehaviour
/
AttachableNode
是一种替代的“附加”父级系统,可避免传统
NetworkObject
父级的缺陷;
ComponentController
可网络同步组件列表的启用/禁用状态。在NGO 2.0–2.4.x版本中(
NETCODE_GAMEOBJECTS
仍可用,但这些类型尚未存在),以下每个技能都会返回结构化的“需要2.5.0+版本”错误而非失败——请先调用
netcode_version
确认版本。
技能用途关键参数
netcode_version
报告已安装的NGO版本和2.5+功能可用性
netcode_attachable_info
审计场景中AttachableBehaviour / AttachableNode / ComponentController的分布情况
includeInactive?
netcode_attachable_add
为NetworkObject层级下的嵌套GameObject附加
AttachableBehaviour
目标对象 +
autoDetach?
None
/
OnAttachNodeDestroy
/
OnDespawn
/
OnOwnershipChange
,逗号分隔)
netcode_attachable_node_add
附加
AttachableNode
AttachableBehaviour
附加的插槽)
目标对象 +
detachOnDespawn?
netcode_component_controller_add
为GameObject附加
ComponentController
目标对象 +
startEnabled?
netcode_component_controller_configure
设置
StartEnabled
和/或从目标GameObject填充同步组件列表(与在Inspector中拖动GameObject到Components字段的操作一致)
目标对象,
targetPaths?
,
clearExisting?
,
startEnabled?
注意事项:
  • AttachableBehaviour
    必须位于NetworkObject层级下的子GameObject上,不能直接位于NetworkObject自身的GameObject上。
  • AttachableNode
    必须属于与附加到它的
    AttachableBehaviour
    实例不同的
    NetworkObject
  • Attach()
    /
    Detach()
    是仅运行时调用(需要两个实例都已生成),并且故意作为技能暴露——与
    netcode_spawn_object
    不存在的理由相同(参见上文“切勿”部分):调用者必须已拥有运行中的NetworkManager,并从NetworkBehaviour代码中执行此操作。
  • netcode_component_controller_configure
    targetPaths
    接受整个GameObject;NGO自身的
    OnValidate()
    (由本技能调用)会将每个GameObject展开为所有符合条件的子组件(带有公共
    bool enabled
    属性),跳过
    NetworkBehaviour
    /
    NetworkObject
    /
    NetworkManager
    ——与在Inspector中拖动GameObject到Components字段的操作完全一致。

Quick Start

快速开始

python
import unity_skills as u
python
import unity_skills as u

1. Inspect current state

1. 检查当前状态

u.call_skill("netcode_check_setup")
u.call_skill("netcode_check_setup")

2. Create NetworkManager + UnityTransport

2. 创建NetworkManager + UnityTransport

u.call_skill("netcode_create_manager", name="NetworkManager")
u.call_skill("netcode_create_manager", name="NetworkManager")

3. Configure the NetworkConfig

3. 配置NetworkConfig

u.call_skill("netcode_configure_manager", tickRate=30, connectionApproval=False, enableSceneManagement=True, networkTopology="ClientServer")
u.call_skill("netcode_configure_manager", tickRate=30, connectionApproval=False, enableSceneManagement=True, networkTopology="ClientServer")

4. Transport

4. 配置传输层

u.call_skill("netcode_set_transport_address", address="127.0.0.1", port=7777, serverListenAddress="0.0.0.0")
u.call_skill("netcode_set_transport_address", address="127.0.0.1", port=7777, serverListenAddress="0.0.0.0")

5. Player prefab setup

5. 玩家预制体设置

NOTE: add_network_object on a prefab path depends on GameObjectFinder support.

注意:在预制体路径上调用add_network_object依赖GameObjectFinder支持。

Safer route: instantiate the prefab in the scene first, then attach.

更安全的方式:先将预制体实例化到场景中,再附加组件。

u.call_skill("netcode_add_network_object", path="Assets/Prefabs/Player.prefab") u.call_skill("netcode_create_prefabs_list", path="Assets/NetworkPrefabs.asset") u.call_skill("netcode_add_to_prefabs_list", listPath="Assets/NetworkPrefabs.asset", prefabPath="Assets/Prefabs/Player.prefab") u.call_skill("netcode_set_player_prefab", prefabPath="Assets/Prefabs/Player.prefab")
u.call_skill("netcode_add_network_object", path="Assets/Prefabs/Player.prefab") u.call_skill("netcode_create_prefabs_list", path="Assets/NetworkPrefabs.asset") u.call_skill("netcode_add_to_prefabs_list", listPath="Assets/NetworkPrefabs.asset", prefabPath="Assets/Prefabs/Player.prefab") u.call_skill("netcode_set_player_prefab", prefabPath="Assets/Prefabs/Player.prefab")

6. Generate a NetworkBehaviour template

6. 生成NetworkBehaviour模板

u.call_skill("netcode_add_network_behaviour_script", className="PlayerController", path="Assets/Scripts/PlayerController.cs", includeRpc=True, includeNetworkVariable=True)
u.call_skill("netcode_add_network_behaviour_script", className="PlayerController", path="Assets/Scripts/PlayerController.cs", includeRpc=True, includeNetworkVariable=True)

7. Drive the session in PlayMode

7. 在PlayMode中驱动会话

u.call_skill("editor_play") # enter PlayMode u.call_skill("netcode_start_host") u.call_skill("netcode_get_status") u.call_skill("netcode_shutdown") u.call_skill("editor_stop")
undefined
u.call_skill("editor_play") # 进入PlayMode u.call_skill("netcode_start_host") u.call_skill("netcode_get_status") u.call_skill("netcode_shutdown") u.call_skill("editor_stop")
undefined

Critical Rules (must read)

关键规则(必须阅读)

  1. Spawn/Despawn are not exposed as skills. They must be called from NetworkBehaviour runtime code (Server authority). Skills handle prefab registration and NetworkManager lifecycle only.
  2. PlayerPrefab must be in a NetworkPrefabsList (enforced at runtime on 2.x). Register it with
    netcode_add_to_prefabs_list
    .
  3. Runtime control skills (start_*/shutdown) require PlayMode. Calls from Edit Mode return an error.
  4. Address vs ServerListenAddress have different meaning. On a client,
    Address
    is the target server IP. On a server,
    ServerListenAddress
    is the bind address (usually
    0.0.0.0
    ).
  5. useRigidbody2D
    switches between NetworkRigidbody and NetworkRigidbody2D. Unrelated physics settings (e.g.
    Physics2D.AutoSyncTransforms
    ) live elsewhere.
  1. 生成/销毁操作未作为技能暴露。它们必须从NetworkBehaviour运行时代码中调用(服务器权限)。技能仅处理预制体注册和NetworkManager生命周期。
  2. 玩家预制体必须在网络预制体列表中(2.x版本运行时强制要求)。使用
    netcode_add_to_prefabs_list
    注册。
  3. 运行时控制技能(start_*/shutdown)需要PlayMode。在编辑模式下调用会返回错误。
  4. Address与ServerListenAddress含义不同。在客户端,
    Address
    是目标服务器IP。在服务器,
    ServerListenAddress
    是绑定地址(通常为
    0.0.0.0
    )。
  5. **
    useRigidbody2D
    **用于切换NetworkRigidbody和NetworkRigidbody2D。无关的物理设置(如
    Physics2D.AutoSyncTransforms
    )在其他地方配置。

Version Scope

版本范围

Targets NGO 2.x (validated against 2.13.1). Legacy 1.x (old prefabs list layout, different RPC model) is out of scope for this module. The NGO 2.5+ features skills additionally require 2.5.0+ within that range; call
netcode_version
to check before relying on them.
针对NGO 2.x版本(已针对2.13.1验证)。旧版1.x(旧预制体列表布局、不同RPC模型)不在本模块的范围内。NGO 2.5+功能中的技能还需要该范围内的2.5.0+版本;在依赖这些技能之前,请调用
netcode_version
检查版本。

Exact Signatures

精确签名

For exact parameter names, defaults, and return fields, query
GET /skills/schema
or
unity_skills.get_skill_schema()
. This document is a routing and best-practice guide, not the authoritative signature source.
如需精确的参数名称、默认值和返回字段,请查询
GET /skills/schema
unity_skills.get_skill_schema()
。本文档是路由和最佳实践指南,并非权威签名来源。