unity-smart

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Unity Smart Skills

Unity智能技能

Guardrails

使用规范

Mode: Full-Auto required
DO NOT (common hallucinations):
  • smart_create
    /
    smart_build
    do not exist → smart skills are query/layout tools, not creation tools
  • smart_search
    does not exist → use
    smart_query
    for SQL-like scene queries
  • smart_move
    does not exist → use
    smart_snap_to_grid
    or
    smart_align_to_ground
Routing:
  • For creating objects → use
    gameobject
    module
  • For simple object search → use
    gameobject_find
    or
    scene_find_objects
  • For complex scene queries (SQL-like) →
    smart_query
    (this module)
模式:需设置为全自动
禁止操作(常见错误):
  • smart_create
    /
    smart_build
    不存在 → 智能技能是查询/布局工具,而非创建工具
  • smart_search
    不存在 → 请使用
    smart_query
    进行类SQL场景查询
  • smart_move
    不存在 → 请使用
    smart_snap_to_grid
    smart_align_to_ground
路由指引
  • 创建对象 → 使用
    gameobject
    模块
  • 简单对象搜索 → 使用
    gameobject_find
    scene_find_objects
  • 复杂场景查询(类SQL) →
    smart_query
    (本模块)

Skills

技能列表

smart_scene_query

smart_scene_query

Find objects based on component property values (SQL-like).
ParameterTypeRequiredDefaultDescription
componentName
stringYes-Component type (Light, Camera, MeshRenderer)
propertyName
stringYes-Property to query (intensity, enabled, etc.)
op
stringNo"=="==, !=, >, <, >=, <=, contains
value
stringNonullValue to compare
limit
intNo50Max results
query
stringNonullUnsupported shorthand; if provided alone returns a guidance error
Example:
python
undefined
根据组件属性值查找对象(类SQL)。
参数类型必填默认值描述
componentName
string-组件类型(Light、Camera、MeshRenderer)
propertyName
string-要查询的属性(intensity、enabled等)
op
string"=="==、!=、>、<、>=、<=、contains
value
stringnull要比较的值
limit
int50最大结果数
query
stringnull不支持的简写形式;若单独传入会返回指引错误
示例
python
undefined

Find all lights with intensity > 2

查找所有强度大于2的灯光

call_skill("smart_scene_query", componentName="Light", propertyName="intensity", op=">", value="2")

---
call_skill("smart_scene_query", componentName="Light", propertyName="intensity", op=">", value="2")

---

smart_scene_layout

smart_scene_layout

Organize selected objects into a layout.
ParameterTypeRequiredDefaultDescription
layoutType
stringNo"Linear"Linear, Grid, Circle, Arc
axis
stringNo"X"X, Y, Z, -X, -Y, -Z
spacing
floatNo2.0Space between items (or radius)
columns
intNo3For Grid layout
arcAngle
floatNo180For Arc layout (degrees)
lookAtCenter
boolNofalseRotate to face center
Example:
python
undefined
将选中的对象整理为指定布局。
参数类型必填默认值描述
layoutType
string"Linear"Linear(线性)、Grid(网格)、Circle(圆形)、Arc(弧形)
axis
string"X"X、Y、Z、-X、-Y、-Z
spacing
float2.0项目间距(或半径)
columns
int3适用于Grid布局
arcAngle
float180适用于Arc布局(度数)
lookAtCenter
boolfalse旋转至朝向中心
示例
python
undefined

Arrange selected objects in a circle

将选中对象排列为圆形

call_skill("smart_scene_layout", layoutType="Circle", spacing=5)

---
call_skill("smart_scene_layout", layoutType="Circle", spacing=5)

---

smart_reference_bind

smart_reference_bind

Auto-fill a List/Array field with matching objects.
ParameterTypeRequiredDefaultDescription
targetName
stringYes-Target GameObject
componentName
stringYes-Component on target
fieldName
stringYes-Field to fill
sourceTag
stringNonullFind by tag
sourceName
stringNonullFind by name contains
appendMode
boolNofalseAppend instead of replace
Example:
python
undefined
自动用匹配对象填充List/Array字段。
参数类型必填默认值描述
targetName
string-目标GameObject
componentName
string-目标对象上的组件
fieldName
string-要填充的字段
sourceTag
stringnull按标签查找
sourceName
stringnull按名称包含查找
appendMode
boolfalse追加而非替换
示例
python
undefined

Fill GameManager.spawns with all SpawnPoint tagged objects

将所有带有SpawnPoint标签的对象填充到GameManager的spawns字段中

call_skill("smart_reference_bind", targetName="GameManager", componentName="GameController", fieldName="spawns", sourceTag="SpawnPoint")

---
call_skill("smart_reference_bind", targetName="GameManager", componentName="GameController", fieldName="spawns", sourceTag="SpawnPoint")

---

smart_scene_query_spatial

smart_scene_query_spatial

Find objects within a sphere/box region, optionally filtered by component.
ParameterTypeRequiredDefaultDescription
x
floatYes-Center X coordinate
y
floatYes-Center Y coordinate
z
floatYes-Center Z coordinate
radius
floatNo10Search sphere radius
componentFilter
stringNonullOnly include objects with this component
limit
intNo50Max results
Returns:
{ success, count, center, radius, results }

查找球体/盒子区域内的对象,可按组件筛选。
参数类型必填默认值描述
x
float-中心X坐标
y
float-中心Y坐标
z
float-中心Z坐标
radius
float10搜索球体半径
componentFilter
stringnull仅包含带有该组件的对象
limit
int50最大结果数
返回值
{ success, count, center, radius, results }

smart_align_to_ground

smart_align_to_ground

Raycast selected objects downward to align them to the ground. Requires objects selected in Hierarchy first.
ParameterTypeRequiredDefaultDescription
maxDistance
floatNo100Maximum raycast distance
alignRotation
boolNofalseAlign rotation to surface normal
Returns:
{ success, aligned, total }

向下射线检测选中对象,使其对齐地面。需先在层级面板中选中对象。
参数类型必填默认值描述
maxDistance
float100最大射线检测距离
alignRotation
boolfalse对齐旋转至表面法线
返回值
{ success, aligned, total }

smart_distribute

smart_distribute

Evenly distribute selected objects between first and last positions. Requires at least 3 objects selected in Hierarchy first.
ParameterTypeRequiredDefaultDescription
axis
stringNo"X"X, Y, Z, -X, -Y, -Z
Returns:
{ success, distributed, axis }

在第一个和最后一个对象的位置之间均匀分布选中对象。需先在层级面板中选中至少3个对象。
参数类型必填默认值描述
axis
string"X"X、Y、Z、-X、-Y、-Z
返回值
{ success, distributed, axis }

smart_snap_to_grid

smart_snap_to_grid

Snap selected objects to a grid.
ParameterTypeRequiredDefaultDescription
gridSize
floatNo1Grid cell size
Returns:
{ success, snapped, gridSize }

将选中对象对齐到网格。
参数类型必填默认值描述
gridSize
float1网格单元格大小
返回值
{ success, snapped, gridSize }

smart_randomize_transform

smart_randomize_transform

Randomize position/rotation/scale of selected objects within ranges.
ParameterTypeRequiredDefaultDescription
posRange
floatNo0Position randomization range
rotRange
floatNo0Rotation randomization range (degrees)
scaleMin
floatNo1Minimum uniform scale
scaleMax
floatNo1Maximum uniform scale
Returns:
{ success, randomized }

在指定范围内随机化选中对象的位置/旋转/缩放。
参数类型必填默认值描述
posRange
float0位置随机化范围
rotRange
float0旋转随机化范围(度数)
scaleMin
float1最小统一缩放比例
scaleMax
float1最大统一缩放比例
返回值
{ success, randomized }

smart_replace_objects

smart_replace_objects

Replace selected objects with a prefab (preserving transforms). Requires objects selected in Hierarchy first.
ParameterTypeRequiredDefaultDescription
prefabPath
stringYes-Asset path to the replacement prefab
Returns:
{ success, replaced, prefab }

用预制体替换选中对象(保留变换属性)。需先在层级面板中选中对象。
参数类型必填默认值描述
prefabPath
string-替换预制体的资源路径
返回值
{ success, replaced, prefab }

smart_select_by_component

smart_select_by_component

Select all objects that have a specific component.
ParameterTypeRequiredDefaultDescription
componentName
stringYes-Component type name to search for
Returns:
{ success, selected, component }

选中所有带有指定组件的对象。
参数类型必填默认值描述
componentName
string-要搜索的组件类型名称
返回值
{ success, selected, component }

Exact Signatures

精确签名

Exact names, parameters, defaults, and returns are defined by
GET /skills/schema
or
unity_skills.get_skill_schema()
, not by this file.
精确的名称、参数、默认值和返回值由
GET /skills/schema
unity_skills.get_skill_schema()
定义,而非本文件。