unity-development
БесплатноБез исполняемых скриптовНе проверенComprehensive guide for Unity development. Provides architecture patterns, MCP tool selection, and composite task workflows. Parent skill always referenced…
Об этом скилле
Unity Development Guide
A comprehensive guide for Unity development. This skill serves as always-referenced parent skill, providing common patterns and tool selection guidance.
Architecture Patterns
Fail-Fast Principle
Do not write null checks. Use objects directly when their existence is assumed.
// NG: Forbidden pattern
if (component != null) { component.DoSomething(); }
if (gameObject != null) { gameObject.SetActive(false); }
if (service != null) { service.Execute(); }
// OK: Correct pattern - direct usage
GetComponent<Rigidbody>().velocity = Vector3.zero;
GameService.Initialize();
target.position = Vector3.zero;
Applies to:
- Null check after
GetComponent<T>() - Null check after
Find*() - Null check after
[Inject]
No GetComponent in Update
GetComponent every frame causes GC allocation and performance degradation. Cache in Awake.
// NG: GC allocation every frame
void Update()
{
GetComponent<Rigidbody>().velocity = input;
}
// OK: Cache in Awake
private Rigidbody _rb;
void Awake()
{
_rb = GetComponent<Rigidbody>();
}
void Update()
{
_rb.velocity = input;
}
UniTask Patterns
Use UniTask instead of coroutines. async void is forbidden.
using Cysharp.Threading.Tasks;
// NG: async void
async void Start()
{
await DoWorkAsync();
}
// OK: UniTaskVoid + destroyCancellationToken
async UniTaskVoid Start()
{
await DoWorkAsync(destroyCancellationToken);
}
// OK: When return value is needed
async UniTask<int> CalculateAsync(CancellationToken ct)
{
await UniTask.Delay(1000, cancellationToken: ct);
return 42;
}
Best Practices:
- Use
destroyCancellationTokenfor auto-cancel on GameObject destruction UniTask.Delay>Task.Delay(zero allocation)UniTask.WhenAllfor parallel execution
VContainer DI
Use VContainer for dependency injection. Constructor injection recommended.
// Interface definition
public interface IPlayerService
{
void Initialize();
}
// Implementation class
public class PlayerService : IPlayerService
{
public void Initialize() { /* ... */ }
}
// Consumer (MonoBehaviour)
public class GameManager : MonoBehaviour
{
[Inject] private readonly IPlayerService _playerService;
void Start()
{
_playerService.Initialize();
}
}
// LifetimeScope configuration
public class GameLifetimeScope : LifetimeScope
{
protected override void Configure(IContainerBuilder builder)
{
builder.Register<IPlayerService, PlayerService>(Lifetime.Singleton);
builder.RegisterComponentInHierarchy<GameManager>();
}
}
Lifetime Selection:
Lifetime.Singleton- One instance for entire appLifetime.Scoped- One instance per sceneLifetime.Transient- New instance each time
MCP Tool Categories
C# Code Editing
| Tool | Purpose | Usage Condition |
|---|---|---|
edit_snippet |
Lightweight edit | Diff within 80 characters |
edit_structured |
Structured edit | Method body replacement, member addition |
get_symbols |
Symbol list | Required before editing |
find_symbol |
Symbol search | Find symbol by name |
find_refs |
Reference search | Before refactoring |
read |
Read code | Check file contents |
search |
Pattern search | Regex search |
create_class |
Create class | New file |
rename_symbol |
Rename | Project-wide |
remove_symbol |
Remove symbol | Delete unused code |
Scene & GameObject
| Tool | Purpose |
|---|---|
get_hierarchy |
Get hierarchy |
create_gameobject |
Create GameObject |
modify_gameobject |
Modify GameObject |
delete_gameobject |
Delete GameObject |
find_gameobject |
Find GameObject |
add_component |
Add component |
modify_component |
Modify component |
remove_component |
Remove component |
list_components |
List components |
Asset Management
| Tool | Purpose |
|---|---|
create_prefab |
Create prefab |
modify_prefab |
Modify prefab |
instantiate_prefab |
Instantiate prefab |
create_material |
Create material |
modify_material |
Modify material |
manage_asset_database |
Asset operations |
addressables_manage |
Addressables management |
PlayMode & Testing
| Tool | Purpose |
|---|---|
play_game |
Start PlayMode |
stop_game |
Stop PlayMode |
pause_game |
Pause |
input_keyboard |
Keyboard input |
input_mouse |
Mouse input |
input_gamepad |
Gamepad input |
capture_screenshot |
Screenshot |
run_tests |
Run tests |
UI Systems
| System | Purpose | Detail Skill |
|---|---|---|
| uGUI | Game UI (Canvas/EventSystem) | unity-game-ugui-design |
| UI Toolkit | Modern UI (Runtime/Editor) | unity-game-ui-toolkit-design |
| IMGUI | Editor extensions only | unity-editor-imgui-design |
Composite Workflow Examples
Example 1: Scene Transition with UI B
Установить unity-development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobFAQ
Что делает скилл unity-development?
Comprehensive guide for Unity development. Provides architecture patterns, MCP tool selection, and composite task workflows. Parent skill always referenced for Unity-related tasks. See child skills for detailed implementation. Use when: Unity development in general, C# editing, scene operations, UI implementation, asset management, PlayMode testing
Как установить скилл unity-development?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл unity-development запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic