Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

unity-scriptUnity script 搜索

Agent Skill

unity-script 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

321

周安装

13

GitHub Stars

886

下载量

101
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:unity-script(Unity script 搜索)
来源仓库:https://github.com/besty0728/unity-skills
仓库路径:skills/unity-script
安装命令:
npx skills add https://github.com/besty0728/unity-skills --skill unity-script
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/besty0728/unity-skills --skill unity-script

简介

Unity 脚本搜索技能,用于查找和筛选相关技术资料。

  • 适用于关键词驱动的信息检索任务,支持多宿主环境调用。
  • 可结合任务场景快速定位候选脚本或解决方案。
  • 安装命令:npx skills add https://github.com/besty0728/unity-skills --skill unity-script
  • 注意检查来源仓库维护频率和实际功能覆盖范围

SKILL.md

Unity Script Skills

BATCH-FIRST: Use script_create_batch when creating 2+ scripts. DESIGN-FIRST: Before creating gameplay scripts, actively consider coupling, performance, and maintainability. In an existing project, load ../project-scout/SKILL.md first. If the user is asking for architecture or refactoring advice, load ../architecture/SKILL.md and then ../patterns/SKILL.md, ../async/SKILL.md, ../inspector/SKILL.md, ../performance/SKILL.md, ../script-roles/SKILL.md, ../scene-contracts/SKILL.md, ../testability/SKILL.md, or ../scriptdesign/SKILL.md as needed.

Guardrails

Mode: Semi-Auto (available by default)

DO NOT (common hallucinations):

  • script_edit / script_update do not exist → use script_replace for find-and-replace
  • script_write does not exist → use script_create (new file) or script_replace (modify existing)
  • scriptName parameter must NOT include .cs extension
  • Templates only accept: MonoBehaviour, ScriptableObject, Editor, EditorWindow

Routing:

  • To modify existing script content → script_replace (find/replace) or script_append (add lines)
  • To read script → script_read
  • To check compile errors → script_get_compile_feedback
  • To analyze script API → use perception module's script_analyze

Skills Overview

Single ObjectBatch VersionUse Batch When
script_createscript_create_batchCreating 2+ scripts

No batch needed:

  • script_read - Read script content
  • script_delete - Delete script
  • script_find_in_file - Search in scripts
  • script_append - Append content to script
  • script_get_compile_feedback - Check compile errors for one script after Unity finishes compiling
  • create_script() in scripts/unity_skills.py now waits for Unity to come back once and refreshes compile feedback automatically after script creation.

Skills

script_create

Create a C# script from template.

ParameterTypeRequiredDefaultDescription
scriptNamestringYes-Script class name
folderstringNo"Assets/Scripts"Save folder
templatestringNo"MonoBehaviour"Template type
namespaceNamestringNonullOptional namespace

Templates: MonoBehaviour, ScriptableObject, Editor, EditorWindow

Returns: {success, path, className, namespaceName, designReminder, compilation?}

compilation includes:

  • isCompiling
  • hasErrors
  • errorCount
  • errors[]
  • nextAction

script_create_batch

Create multiple scripts in one call.

Returns: {success, totalItems, successCount, failCount, results: [{success, path, className}], compilation?}

Before batch creation, decide whether each script should be:

  • a thin MonoBehaviour bridge
  • a ScriptableObject configuration asset
  • or a plain C# domain/service class generated from a custom template
unity_skills.call_skill("script_create_batch", items=[
    {"scriptName": "PlayerController", "folder": "Assets/Scripts/Player", "template": "MonoBehaviour"},
    {"scriptName": "EnemyAI", "folder": "Assets/Scripts/Enemy", "template": "MonoBehaviour"},
    {"scriptName": "GameSettings", "folder": "Assets/Scripts/Data", "template": "ScriptableObject"}
])

script_read

Read script content.

ParameterTypeRequiredDescription
scriptPathstringYesScript asset path

Returns: {success, path, content}

script_delete

Delete a script.

ParameterTypeRequiredDescription
scriptPathstringYesScript to delete

script_find_in_file

Search for patterns in scripts.

ParameterTypeRequiredDefaultDescription
patternstringYes-Search pattern
folderstringNo"Assets"Search folder
isRegexboolNofalseUse regex
limitintNo100Max results

Returns: {success, pattern, totalMatches, matches: [{file, line, content}]}

script_append

Append content to a script.

ParameterTypeRequiredDefaultDescription
scriptPathstringYes-Script path
contentstringYes-Content to append
atLineintNoendLine number to insert at

script_get_compile_feedback

Get compile diagnostics related to one script.

ParameterTypeRequiredDefaultDescription
scriptPathstringYes-Script path
limitintNo20Max diagnostics

Example: Efficient Script Setup

import unity_skills

# BAD: 3 API calls + 3 Domain Reloads
unity_skills.call_skill("script_create", scriptName="PlayerController", folder="Assets/Scripts/Player")
# Wait for Domain Reload...
unity_skills.call_skill("script_create", scriptName="EnemyAI", folder="Assets/Scripts/Enemy")
# Wait for Domain Reload...
unity_skills.call_skill("script_create", scriptName="GameManager", folder="Assets/Scripts/Core")
# Wait for Domain Reload...

# GOOD: 1 API call + 1 Domain Reload
unity_skills.call_skill("script_create_batch", items=[
    {"scriptName": "PlayerController", "folder": "Assets/Scripts/Player"},
    {"scriptName": "EnemyAI", "folder": "Assets/Scripts/Enemy"},
    {"scriptName": "GameManager", "folder": "Assets/Scripts/Core"}
])
# Wait for Domain Reload once...

Important: Domain Reload And Compile Feedback

After creating or editing scripts, Unity triggers a Domain Reload (recompilation). Use the returned compilation field first. If isCompiling=true, wait for Unity to finish and then call script_get_compile_feedback.

import time

result = unity_skills.call_skill("script_create", scriptName="MyScript")
time.sleep(5)  # Wait for Unity to recompile if result["compilation"]["isCompiling"] is true
feedback = unity_skills.call_skill("script_get_compile_feedback", scriptPath=result["path"])
unity_skills.call_skill("component_add", name="Player", componentType="MyScript")

Best Practices

  1. Use meaningful script names matching class name
  2. Organize scripts in logical folders
  3. Before creating gameplay code, decide the class role first: MonoBehaviour, ScriptableObject, or plain C# helper/service
  4. Actively reduce coupling: prefer explicit dependencies, small responsibilities, and event-driven notifications over hidden globals
  5. Actively consider performance: avoid unnecessary Update, repeated Find, reflection in hot paths, and avoidable allocations
  6. Actively consider maintainability: clear naming, explicit ownership, Inspector-friendly fields, and simple module boundaries
  7. Avoid giant boilerplate/template dumps. Start from the smallest structure that solves the current need
  8. Do not default to UniTask or a global event bus unless the project context justifies them
  9. Avoid cryptic abbreviations in class, field, and method names unless they are already a project convention
  10. Use templates for correct base class
  11. Wait for compilation after creating scripts
  12. After script edits, call script_get_compile_feedback and fix reported errors
  13. Use regex search for complex patterns
  14. Use batch creation to minimize Domain Reloads

Additional Skills

script_replace

Find and replace content in a script file.

ParameterTypeRequiredDefaultDescription
scriptPathstringYes-Script asset path
findstringYes-Text or pattern to find
replacestringYes-Replacement text
isRegexboolNofalseUse regex matching
checkCompileboolNotrueCheck compilation after replace
diagnosticLimitintNo20Max compile diagnostics

Returns: {success, path, replacements, compilation?}

script_list

List C# script files in the project.

ParameterTypeRequiredDefaultDescription
folderstringNo"Assets"Folder to search in
filterstringNonullFilter string for path matching
limitintNo100Max results

Returns: {count, scripts: [{path, name}]}

script_get_info

Get script info (class name, base class, methods).

ParameterTypeRequiredDefaultDescription
scriptPathstringYes-Script asset path

Returns: {path, className, baseClass, namespaceName, isMonoBehaviour, publicMethods, publicFields}

script_rename

Rename a script file.

ParameterTypeRequiredDefaultDescription
scriptPathstringYes-Script asset path
newNamestringYes-New script name (without extension)
checkCompileboolNotrueCheck compilation after rename
diagnosticLimitintNo20Max compile diagnostics

Returns: {success, path, oldPath, newName, compilation?}

script_move

Move a script to a new folder.

ParameterTypeRequiredDefaultDescription
scriptPathstringYes-Script asset path
newFolderstringYes-Destination folder. Must already exist.
checkCompileboolNotrueCheck compilation after move
diagnosticLimitintNo20Max compile diagnostics

Returns: {success, path, oldPath, newPath, compilation?}


Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.11%
按下载量换算37

Claude

30.42%
按下载量换算31

Cursor

19.48%
按下载量换算20

Gemini CLI

9.21%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills