unity-skills
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUnity Skills API
Unity Skills API
RULE: 2+ objects → useskill (1 call vs N calls)*_batch
规则:处理2个及以上对象时,请使用技能(1次调用替代N次调用)*_batch
Batch Skills (Use First!)
批量技能(优先使用!)
| Skill | items format |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 技能 | 项格式 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Single Skills
单个技能
gameobject
gameobject
| Skill | Parameters |
|---|---|
| name?, primitiveType?, x?, y?, z?, parentName? |
| name?, instanceId?, path? |
| name?, tag?, layer?, component?, useRegex?, limit? → returns list |
| name?, instanceId?, path? |
| name, posX?, posY?, posZ?, rotX?, rotY?, rotZ?, scaleX?, scaleY?, scaleZ? |
| name, parentName |
| name, active |
| name?, instanceId? → returns copyName, copyInstanceId |
| name?, instanceId?, newName |
primitiveType: Cube, Sphere, Capsule, Cylinder, Plane, Quad, Empty(null)
| 技能 | 参数 |
|---|---|
| name?, primitiveType?, x?, y?, z?, parentName? |
| name?, instanceId?, path? |
| name?, tag?, layer?, component?, useRegex?, limit? → 返回列表 |
| name?, instanceId?, path? |
| name, posX?, posY?, posZ?, rotX?, rotY?, rotZ?, scaleX?, scaleY?, scaleZ? |
| name, parentName |
| name, active |
| name?, instanceId? → 返回copyName, copyInstanceId |
| name?, instanceId?, newName |
primitiveType可选值:Cube、Sphere、Capsule、Cylinder、Plane、Quad、Empty(null)
component
component
| Skill | Parameters |
|---|---|
| name, componentType |
| name, componentType |
| name → returns components[] |
| name, componentType, propertyName, value |
| name, componentType |
componentType: Rigidbody, BoxCollider, SphereCollider, CapsuleCollider, MeshCollider, CharacterController, AudioSource, Light, Camera, Animator, etc.
| 技能 | 参数 |
|---|---|
| name, componentType |
| name, componentType |
| name → 返回components[] |
| name, componentType, propertyName, value |
| name, componentType |
componentType可选值:Rigidbody、BoxCollider、SphereCollider、CapsuleCollider、MeshCollider、CharacterController、AudioSource、Light、Camera、Animator等
material
material
| Skill | Parameters |
|---|---|
| name, shaderName?, savePath? |
| name?, instanceId?, path?, materialPath |
| name?, path?, r, g, b, a?, propertyName?, intensity? |
| name?, path?, r, g, b, intensity?, enableEmission? |
| name?, path?, texturePath, propertyName? |
| name?, path?, propertyName, value |
| name?, path?, propertyName, value |
| name?, path?, propertyName, x, y, z?, w? |
| name?, path?, keyword, enable? |
| name?, path?, renderQueue |
| name?, path?, shaderName |
| name?, path?, propertyName?, x, y |
| name?, path?, propertyName?, x, y |
| name?, path? |
| name?, path? |
| sourcePath, newName, savePath? |
| 技能 | 参数 |
|---|---|
| name, shaderName?, savePath? |
| name?, instanceId?, path?, materialPath |
| name?, path?, r, g, b, a?, propertyName?, intensity? |
| name?, path?, r, g, b, intensity?, enableEmission? |
| name?, path?, texturePath, propertyName? |
| name?, path?, propertyName, value |
| name?, path?, propertyName, value |
| name?, path?, propertyName, x, y, z?, w? |
| name?, path?, keyword, enable? |
| name?, path?, renderQueue |
| name?, path?, shaderName |
| name?, path?, propertyName?, x, y |
| name?, path?, propertyName?, x, y |
| name?, path? |
| name?, path? |
| sourcePath, newName, savePath? |
scene
scene
| Skill | Parameters |
|---|---|
| scenePath |
| scenePath, additive? |
| scenePath? |
| (none) → name, path, isDirty, rootObjects |
| maxDepth? → hierarchy tree |
| filename?, width?, height? |
| 技能 | 参数 |
|---|---|
| scenePath |
| scenePath, additive? |
| scenePath? |
| 无参数 → 返回name、path、isDirty、rootObjects |
| maxDepth? → 返回层级树 |
| filename?, width?, height? |
light
light
| Skill | Parameters |
|---|---|
| name?, lightType?, x?, y?, z?, r?, g?, b?, intensity?, range?, spotAngle?, shadows? |
| name, r?, g?, b?, intensity?, range?, shadows? |
| name |
| lightType?, limit? → returns list |
| name, enabled |
lightType: Directional, Point, Spot, Area | shadows: none, hard, soft
| 技能 | 参数 |
|---|---|
| name?, lightType?, x?, y?, z?, r?, g?, b?, intensity?, range?, spotAngle?, shadows? |
| name, r?, g?, b?, intensity?, range?, shadows? |
| name |
| lightType?, limit? → 返回列表 |
| name, enabled |
lightType可选值:Directional、Point、Spot、Area | shadows可选值:none、hard、soft
prefab
prefab
| Skill | Parameters |
|---|---|
| gameObjectName?, instanceId?, savePath |
| prefabPath, x?, y?, z?, name?, parentName? |
| gameObjectName?, instanceId? |
| gameObjectName?, instanceId?, completely? |
| 技能 | 参数 |
|---|---|
| gameObjectName?, instanceId?, savePath |
| prefabPath, x?, y?, z?, name?, parentName? |
| gameObjectName?, instanceId? |
| gameObjectName?, instanceId?, completely? |
asset
asset
| Skill | Parameters |
|---|---|
| sourcePath, destinationPath |
| assetPath |
| sourcePath, destinationPath |
| assetPath |
| searchFilter, searchInFolders?, limit? → returns paths |
| folderPath |
| (none) |
| assetPath |
searchFilter: t:Texture2D, t:Material, t:Prefab, t:AudioClip, t:Script, name, l:Label
| 技能 | 参数 |
|---|---|
| sourcePath, destinationPath |
| assetPath |
| sourcePath, destinationPath |
| assetPath |
| searchFilter, searchInFolders?, limit? → 返回路径列表 |
| folderPath |
| 无参数 |
| assetPath |
searchFilter可选值:t:Texture2D、t:Material、t:Prefab、t:AudioClip、t:Script、name、l:Label
ui
ui
| Skill | Parameters |
|---|---|
| name?, renderMode? |
| name?, parent?, r?, g?, b?, a?, width?, height? |
| name?, parent?, text?, width?, height?, x?, y? |
| name?, parent?, text?, fontSize?, r?, g?, b?, a?, width?, height? |
| name?, parent?, spritePath?, r?, g?, b?, a?, width?, height? |
| name?, parent?, placeholder?, width?, height? |
| name?, parent?, minValue?, maxValue?, value?, width?, height? |
| name?, parent?, label?, isOn? |
| name, text |
| uiType?, limit? |
renderMode: ScreenSpaceOverlay, ScreenSpaceCamera, WorldSpace | uiType: Button, Text, Image, Panel, Slider, Toggle, InputField
| 技能 | 参数 |
|---|---|
| name?, renderMode? |
| name?, parent?, r?, g?, b?, a?, width?, height? |
| name?, parent?, text?, width?, height?, x?, y? |
| name?, parent?, text?, fontSize?, r?, g?, b?, a?, width?, height? |
| name?, parent?, spritePath?, r?, g?, b?, a?, width?, height? |
| name?, parent?, placeholder?, width?, height? |
| name?, parent?, minValue?, maxValue?, value?, width?, height? |
| name?, parent?, label?, isOn? |
| name, text |
| uiType?, limit? |
renderMode可选值:ScreenSpaceOverlay、ScreenSpaceCamera、WorldSpace | uiType可选值:Button、Text、Image、Panel、Slider、Toggle、InputField
script
script
| Skill | Parameters |
|---|---|
| scriptName, folder?, template?, namespace? |
| scriptPath → content |
| scriptPath |
| pattern, folder?, isRegex?, limit? → matches |
| scriptPath, content, atLine? |
template: MonoBehaviour, ScriptableObject, Editor, EditorWindow
| 技能 | 参数 |
|---|---|
| scriptName, folder?, template?, namespace? |
| scriptPath → 返回内容 |
| scriptPath |
| pattern, folder?, isRegex?, limit? → 返回匹配结果 |
| scriptPath, content, atLine? |
template可选值:MonoBehaviour、ScriptableObject、Editor、EditorWindow
editor
editor
| Skill | Parameters |
|---|---|
| (none) |
| (none) |
| (none) |
| gameObjectName?, instanceId? |
| (none) → selected objects with instanceId |
| includeComponents?, includeChildren? → selection, assets, scene info |
| (none) |
| (none) |
| (none) → isPlaying, isPaused, isCompiling |
| menuPath |
| (none) |
| (none) |
menuPath: "File/Save", "Edit/Play", "GameObject/Create Empty", "Assets/Refresh"
| 技能 | 参数 |
|---|---|
| 无参数 |
| 无参数 |
| 无参数 |
| gameObjectName?, instanceId? |
| 无参数 → 返回包含instanceId的选中对象 |
| includeComponents?, includeChildren? → 返回选中内容、资源、场景信息 |
| 无参数 |
| 无参数 |
| 无参数 → 返回isPlaying、isPaused、isCompiling |
| menuPath |
| 无参数 |
| 无参数 |
menuPath示例:"File/Save"、"Edit/Play"、"GameObject/Create Empty"、"Assets/Refresh"
animator
animator
| Skill | Parameters |
|---|---|
| name, folder? |
| controllerPath, paramName, paramType, defaultValue? |
| controllerPath |
| name, paramName, paramType, floatValue?/intValue?/boolValue? |
| name, stateName, layer?, normalizedTime? |
| name |
| name, controllerPath |
| controllerPath, layer? |
paramType: float, int, bool, trigger
| 技能 | 参数 |
|---|---|
| name, folder? |
| controllerPath, paramName, paramType, defaultValue? |
| controllerPath |
| name, paramName, paramType, floatValue?/intValue?/boolValue? |
| name, stateName, layer?, normalizedTime? |
| name |
| name, controllerPath |
| controllerPath, layer? |
paramType可选值:float、int、bool、trigger
shader
shader
| Skill | Parameters |
|---|---|
| shaderName, savePath, template? |
| shaderPath |
| filter?, limit? |
template: Unlit, Standard, Transparent
| 技能 | 参数 |
|---|---|
| shaderName, savePath, template? |
| shaderPath |
| filter?, limit? |
template可选值:Unlit、Standard、Transparent
workflow (Persistent History)
workflow(持久化历史)
| Skill | Parameters |
|---|---|
| tag, description? |
| (none) |
| name?, instanceId? |
| (none) |
| taskId |
| taskId |
| 技能 | 参数 |
|---|---|
| tag, description? |
| 无参数 |
| name?, instanceId? |
| 无参数 |
| taskId |
| taskId |
console
console
| Skill | Parameters |
|---|---|
| (none) |
| (none) |
| filter?, limit? |
| (none) |
| message, type? |
filter/type: Log, Warning, Error
| 技能 | 参数 |
|---|---|
| 无参数 |
| 无参数 |
| filter?, limit? |
| 无参数 |
| message, type? |
filter/type可选值:Log、Warning、Error
validation
validation
| Skill | Parameters |
|---|---|
| checkMissingScripts?, checkMissingPrefabs?, checkDuplicateNames? |
| searchInPrefabs? |
| dryRun? (default true) |
| rootPath?, dryRun? (default true) |
| assetType?, limit? |
| maxRecommendedSize?, limit? |
| rootPath?, maxDepth? |
| 技能 | 参数 |
|---|---|
| checkMissingScripts?, checkMissingPrefabs?, checkDuplicateNames? |
| searchInPrefabs? |
| dryRun?(默认值true) |
| rootPath?, dryRun?(默认值true) |
| assetType?, limit? |
| maxRecommendedSize?, limit? |
| rootPath?, maxDepth? |
importer
importer
| Skill | Parameters |
|---|---|
| assetPath |
| assetPath, textureType?, maxSize?, filterMode?, compression?, mipmapEnabled?, sRGB?, readable?, spritePixelsPerUnit?, wrapMode? |
| assetPath |
| assetPath, forceToMono?, loadInBackground?, preloadAudioData?, loadType?, compressionFormat?, quality? |
| assetPath |
| assetPath, globalScale?, meshCompression?, isReadable?, generateSecondaryUV?, importBlendShapes?, importCameras?, importLights?, animationType?, importAnimation?, materialImportMode? |
textureType: Default, NormalMap, Sprite, EditorGUI, Cursor, Cookie, Lightmap, SingleChannel
filterMode: Point, Bilinear, Trilinear | compression: None, LowQuality, Normal, HighQuality
loadType: DecompressOnLoad, CompressedInMemory, Streaming | compressionFormat: PCM, Vorbis, ADPCM
animationType: None, Legacy, Generic, Humanoid | meshCompression: Off, Low, Medium, High
| 技能 | 参数 |
|---|---|
| assetPath |
| assetPath, textureType?, maxSize?, filterMode?, compression?, mipmapEnabled?, sRGB?, readable?, spritePixelsPerUnit?, wrapMode? |
| assetPath |
| assetPath, forceToMono?, loadInBackground?, preloadAudioData?, loadType?, compressionFormat?, quality? |
| assetPath |
| assetPath, globalScale?, meshCompression?, isReadable?, generateSecondaryUV?, importBlendShapes?, importCameras?, importLights?, animationType?, importAnimation?, materialImportMode? |
textureType可选值:Default、NormalMap、Sprite、EditorGUI、Cursor、Cookie、Lightmap、SingleChannel
filterMode可选值:Point、Bilinear、Trilinear | compression可选值:None、LowQuality、Normal、HighQuality
loadType可选值:DecompressOnLoad、CompressedInMemory、Streaming | compressionFormat可选值:PCM、Vorbis、ADPCM
animationType可选值:None、Legacy、Generic、Humanoid | meshCompression可选值:Off、Low、Medium、High
physics
physics
| Skill | Parameters |
|---|---|
| originX, originY, originZ, dirX, dirY, dirZ, maxDistance?, layerMask? |
| x, y, z, radius, layerMask? |
| (none) |
| x, y, z |
| 技能 | 参数 |
|---|---|
| originX, originY, originZ, dirX, dirY, dirZ, maxDistance?, layerMask? |
| x, y, z, radius, layerMask? |
| 无参数 |
| x, y, z |
camera
camera
| Skill | Parameters |
|---|---|
| objectName |
| (none) |
| posX, posY, posZ, rotX, rotY, rotZ, size?, instant? |
| x, y, z |
| 技能 | 参数 |
|---|---|
| objectName |
| 无参数 |
| posX, posY, posZ, rotX, rotY, rotZ, size?, instant? |
| x, y, z |
navmesh
navmesh
| Skill | Parameters |
|---|---|
| (none) |
| startX, startY, startZ, endX, endY, endZ, areaMask? |
| 技能 | 参数 |
|---|---|
| 无参数 |
| startX, startY, startZ, endX, endY, endZ, areaMask? |
timeline
timeline
| Skill | Parameters |
|---|---|
| name, folder? |
| directorObjectName, trackName? |
| directorObjectName, trackName?, bindingObjectName? |
| 技能 | 参数 |
|---|---|
| name, folder? |
| directorObjectName, trackName? |
| directorObjectName, trackName?, bindingObjectName? |
cinemachine
cinemachine
| Skill | Parameters |
|---|---|
| name |
| vcamName, componentType, propertyName, value |
| vcamName, followName?, lookAtName? |
| 技能 | 参数 |
|---|---|
| name |
| vcamName, componentType, propertyName, value |
| vcamName, followName?, lookAtName? |
event
event
| Skill | Parameters |
|---|---|
| objectName, componentName, eventName |
| objectName, componentName, eventName, targetObjectName, ... |
| objectName, componentName, eventName |
| 技能 | 参数 |
|---|---|
| objectName, componentName, eventName |
| objectName, componentName, eventName, targetObjectName, ... |
| objectName, componentName, eventName |
project
project
| Skill | Parameters |
|---|---|
| (none) |
| filter?, limit? |
| (none) |
| 技能 | 参数 |
|---|---|
| 无参数 |
| filter?, limit? |
| 无参数 |
optimization
optimization
| Skill | Parameters |
|---|---|
| maxTextureSize?, enableCrunch?, compressionQuality? |
| compressionLevel, filter? |
| 技能 | 参数 |
|---|---|
| maxTextureSize?, enableCrunch?, compressionQuality? |
| compressionLevel, filter? |
profiler
profiler
| Skill | Parameters |
|---|---|
| (none) |
| 技能 | 参数 |
|---|---|
| 无参数 |
package
package
| Skill | Parameters |
|---|---|
| (none) → returns installed packages |
| packageId → returns installed, version |
| packageId, version? |
| packageId |
| (none) |
| version? (2 or 3, default 3) |
| (none) → returns cinemachine/splines status |
| 技能 | 参数 |
|---|---|
| 无参数 → 返回已安装包列表 |
| packageId → 返回installed、version |
| packageId, version? |
| packageId |
| 无参数 |
| version?(可选值2或3,默认3) |
| 无参数 → 返回cinemachine/splines状态 |
Notes
注意事项
- Response: or
{success: true/false, ...data}{success: false, error: "message"} - All operations auto-revert on failure
- After , wait 3-5s for Unity recompile
script_create - Use (from
instanceId/editor_get_selection) for guaranteed uniquenesseditor_get_context - means use name OR instanceId OR path to identify object
name?
- 响应格式:或
{success: true/false, ...data}{success: false, error: "message"} - 所有操作失败时会自动回滚
- 执行后,请等待3-5秒,待Unity完成重新编译
script_create - 建议使用(来自
instanceId/editor_get_selection)确保对象唯一性editor_get_context - 表示可使用名称、instanceId或路径来识别对象
name?