Command Palette

Search for a command to run...

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

unity-editor-tooling

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

Unity Editor tooling, build automation, and asset pipeline customization. PROACTIVELY activate for: (1) writing custom Editor scripts, (2) custom inspectors…

JosiahSiegelот JosiahSiegel★ 67 звёзд на GitHub

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

Unity Editor Scripting and Tooling

Overview

Reference for extending the Unity Editor, automating builds, testing, version control configuration, and package development. Covers custom inspectors, editor windows, build pipeline scripting, CI/CD, and the Unity Test Framework.

Custom Inspectors

Basic Custom Editor

#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;

[CustomEditor(typeof(EnemySpawner))]
public class EnemySpawnerEditor : Editor
{
    SerializedProperty spawnPoints;
    SerializedProperty enemyPrefab;
    SerializedProperty spawnInterval;

    void OnEnable()
    {
        spawnPoints = serializedObject.FindProperty("_spawnPoints");
        enemyPrefab = serializedObject.FindProperty("_enemyPrefab");
        spawnInterval = serializedObject.FindProperty("_spawnInterval");
    }

    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EditorGUILayout.PropertyField(enemyPrefab);
        EditorGUILayout.Slider(spawnInterval, 0.1f, 10f, new GUIContent("Spawn Interval"));

        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Spawn Points", EditorStyles.boldLabel);
        EditorGUILayout.PropertyField(spawnPoints, true);

        if (GUILayout.Button("Add Spawn Point at Origin"))
        {
            spawnPoints.InsertArrayElementAtIndex(spawnPoints.arraySize);
            var newElement = spawnPoints.GetArrayElementAtIndex(spawnPoints.arraySize - 1);
            newElement.vector3Value = Vector3.zero;
        }

        serializedObject.ApplyModifiedProperties();
    }

    void OnSceneGUI()
    {
        var spawner = (EnemySpawner)target;
        // Draw handles in scene view for each spawn point
        for (int i = 0; i < spawner.SpawnPointCount; i++)
        {
            Vector3 point = spawner.GetSpawnPoint(i);
            Vector3 newPoint = Handles.PositionHandle(point, Quaternion.identity);
            if (point != newPoint)
            {
                Undo.RecordObject(spawner, "Move Spawn Point");
                spawner.SetSpawnPoint(i, newPoint);
            }
        }
    }
}
#endif

Key rules:

  • Always wrap editor code in #if UNITY_EDITOR or place in Editor/ folders
  • Use SerializedProperty for undo/redo support and multi-object editing
  • Call serializedObject.Update() before and ApplyModifiedProperties() after changes
  • Use Undo.RecordObject() before direct modifications

PropertyDrawer

[CustomPropertyDrawer(typeof(MinMaxRange))]
public class MinMaxRangeDrawer : PropertyDrawer
{
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        EditorGUI.BeginProperty(position, label, property);
        var min = property.FindPropertyRelative("min");
        var max = property.FindPropertyRelative("max");
        float minVal = min.floatValue;
        float maxVal = max.floatValue;

        position = EditorGUI.PrefixLabel(position, label);
        EditorGUI.MinMaxSlider(position, ref minVal, ref maxVal, 0f, 100f);
        min.floatValue = minVal;
        max.floatValue = maxVal;
        EditorGUI.EndProperty();
    }
}

Use PropertyDrawers for reusable field-level customization. Use CustomEditors for component-level customization.

EditorWindow

public class LevelEditorWindow : EditorWindow
{
    [MenuItem("Tools/Level Editor")]
    static void ShowWindow() => GetWindow<LevelEditorWindow>("Level Editor");

    Vector2 scrollPos;
    string searchFilter = "";

    void OnGUI()
    {
        EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
        searchFilter = EditorGUILayout.TextField(searchFilter, EditorStyles.toolbarSearchField);
        if (GUILayout.Button("Refresh", EditorStyles.toolbarButton, GUILayout.Width(60)))
            RefreshData();
        EditorGUILayout.EndHorizontal();

        scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
        // Draw content
        EditorGUILayout.EndScrollView();
    }

    void OnSelectionChange() => Repaint(); // React to selection changes
}

Use EditorWindow for standalone tools. Use [MenuItem] for menu bar integration. Override OnSelectionChange, OnHierarchyChange, OnProjectChange for reactive updates.

ScriptedImporter

[ScriptedImporter(1, "leveldata")]
public class LevelDataImporter : ScriptedImporter
{
    public override void OnImportAsset(AssetImportContext ctx)
    {
        string json = File.ReadAllText(ctx.assetPath);
        var levelData = ScriptableObject.CreateInstance<LevelData>();
        JsonUtility.FromJsonOverwrite(json, levelData);
        ctx.AddObjectToAsset("main", levelData);
        ctx.SetMainObject(levelData);
    }
}

Register custom file extensions. Unity re-imports automatically when the source file changes.

Build Pipeline

Build Script

public static class BuildScript
{
    [MenuItem("Build/Build Windows")]
    public static void BuildWindows()
    {
        var option
Полный SKILL.md на GitHub

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

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

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

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

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

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

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл unity-editor-tooling?

Unity Editor tooling, build automation, and asset pipeline customization. PROACTIVELY activate for: (1) writing custom Editor scripts, (2) custom inspectors and PropertyDrawer attributes, (3) EditorWindow creation, (4) ScriptedImporter for custom asset types, (5) build pipeline scripting (BuildPipeline.BuildPlayer, IBuildPostprocessor), (6) platform-switching automation, (7) CI/CD for Unity (GameCI, GitHub Actions, Unity Build Automation), (8) Assembly Definition (.asmdef) organization, (9) preprocessor symbols and platform defines, (10) Editor-only code with #if UNITY_EDITOR. Provides: custom inspector templates, EditorWindow examples, build script patterns, GameCI setup, .asmdef best practices, and CI YAML for Unity builds.

Как установить скилл unity-editor-tooling?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл unity-editor-tooling запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить unity-editor-tooling с