Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

unity-development

БесплатноБез исполняемых скриптовНе проверен

Comprehensive guide for Unity development. Provides architecture patterns, MCP tool selection, and composite task workflows. Parent skill always referenced…

akiojinот akiojin★ 33 звезды на GitHub19 установок в других каталогах

Об этом скилле

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 destroyCancellationToken for auto-cancel on GameObject destruction
  • UniTask.Delay > Task.Delay (zero allocation)
  • UniTask.WhenAll for 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 app
  • Lifetime.Scoped - One instance per scene
  • Lifetime.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

Полный SKILL.md на GitHub

Установить unity-development в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Grep
Glob

FAQ

Что делает скилл 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), без исполняемых скриптов.

Похожие скиллы

Сравнить unity-development с