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

unity-editor-toolsUnity editor tools 搜索

Agent Skill

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

总安装

353

周安装

15

GitHub Stars

14

下载量

124
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/nice-wolf-studio/unity-claude-skills --skill unity-editor-tools

简介

用于 Unity Editor Tools 相关信息的查找、检索和筛选,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位编辑器工具资料。

  • 适用于需要根据关键词或任务场景定位候选结果时使用。
  • 通过 npx skills add 命令从 GitHub 仓库安装并使用。
  • 安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。
  • unity-editor-tools 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Unity Editor Tools

Editor Scripting Overview

Editor scripts extend the Unity Editor with custom inspectors, windows, tools, and workflows. All editor code must either live in an Editor/ folder or be wrapped in #if UNITY_EDITOR / #endif -- this ensures editor code is stripped from runtime builds.

Unity 6.3 supports two GUI frameworks for editor extensions:

FrameworkStatusEntry Point
UI ToolkitRecommendedCreateInspectorGUI() / CreateGUI() returning VisualElement
IMGUILegacy, fully functionalOnInspectorGUI() / OnGUI()

Key base classes: Editor, EditorWindow, PropertyDrawer, DecoratorDrawer, ScriptableWizard.


Custom Inspector (Editor)

Derive from Editor, apply [CustomEditor(typeof(TargetType))]. See references/custom-inspectors.md for full guide.

UI Toolkit (Recommended)

[CustomEditor(typeof(MyPlayer))]
public class MyPlayerEditor : Editor
{
    public override VisualElement CreateInspectorGUI()
    {
        VisualElement root = new VisualElement();
        var visualTree = Resources.Load("MyPlayerEditor") as VisualTreeAsset;
        visualTree.CloneTree(root);
        return root;
    }
}

When CreateInspectorGUI() is overridden, OnInspectorGUI() is ignored.

IMGUI with SerializedObject Pattern

[CustomEditor(typeof(LookAtPoint))]
[CanEditMultipleObjects]
public class LookAtPointEditor : Editor
{
    SerializedProperty lookAtPoint;

    void OnEnable() { lookAtPoint = serializedObject.FindProperty("lookAtPoint"); }

    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        EditorGUILayout.PropertyField(lookAtPoint);
        serializedObject.ApplyModifiedProperties();
    }
}

Key Members

MemberDescription
target / targetsInspected object(s)
serializedObjectSerializedObject for the target(s)
DrawDefaultInspector()Renders built-in default inspector
OnSceneGUI()Draw interactive Handles in Scene View

Scene View Integration

public void OnSceneGUI()
{
    var t = (LookAtPoint)target;
    EditorGUI.BeginChangeCheck();
    Vector3 pos = Handles.PositionHandle(t.lookAtPoint, Quaternion.identity);
    if (EditorGUI.EndChangeCheck())
    {
        Undo.RecordObject(target, "Move look-at point");
        t.lookAtPoint = pos;
    }
}

PropertyDrawer and PropertyAttribute

Customize how serialized fields appear in the Inspector. See references/property-drawers.md for full guide.

1. Define attribute (runtime code, outside Editor folder):

public class MyRangeAttribute : PropertyAttribute
{
    public readonly float min, max;
    public MyRangeAttribute(float min, float max) { this.min = min; this.max = max; }
}

2. Implement drawer (Editor folder):

[CustomPropertyDrawer(typeof(MyRangeAttribute))]
public class MyRangeDrawer : PropertyDrawer
{
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        MyRangeAttribute range = (MyRangeAttribute)attribute;
        if (property.propertyType == SerializedPropertyType.Float)
            EditorGUI.Slider(position, property, range.min, range.max, label);
        else if (property.propertyType == SerializedPropertyType.Integer)
            EditorGUI.IntSlider(position, property, (int)range.min, (int)range.max, label);
    }
}

Critical rules: Must be in Editor/ folder. Use EditorGUI (not EditorGUILayout). Use EditorGUI.BeginProperty()/EndProperty() for prefab overrides. Cannot mix UI Toolkit and IMGUI in one drawer.


EditorWindow

Custom dockable editor windows. See references/editor-windows.md for full guide.

Lifecycle: OnEnable -> CreateGUI -> Update -> OnGUI -> OnDisable

public class MyToolWindow : EditorWindow
{
    [MenuItem("Tools/My Tool Window")]
    public static void ShowWindow()
    {
        var window = GetWindow<MyToolWindow>();
        window.titleContent = new GUIContent("My Tool");
        window.minSize = new Vector2(300, 200);
    }

    public void CreateGUI()
    {
        rootVisualElement.Add(new Label("Hello from UI Toolkit!"));
        rootVisualElement.Add(new Button(() => Debug.Log("Clicked!")) { text = "Click Me" });
    }
}
Static MethodDescription
GetWindow<T>()Get existing or create new
CreateWindow<T>()Always create new instance
HasOpenInstances<T>()Check if open
Display ModeBehavior
Show()Standard dockable
ShowUtility()Floating, not dockable
ShowModal()Modal dialog
ShowAsDropDown()Dropdown popup

MenuItem

The [MenuItem] attribute converts static methods into menu commands.

[MenuItem("Menu/Path/Item Name", isValidateFunction, priority)]
PrefixPlacement
"Tools/..."Custom tools menu
"Assets/..."Assets menu + Project context menu
"GameObject/..."GameObject menu + Hierarchy context menu
"CONTEXT/ComponentType/..."Component context menu

Shortcut modifiers: % = Cmd/Ctrl, # = Shift, & = Alt, ^ = Ctrl (all), _ = no modifier.

// Validation function controls when menu item is enabled
[MenuItem("Tools/Reset Position", true)]
static bool ValidateResetPosition() => Selection.activeTransform != null;

[MenuItem("Tools/Reset Position", false)]
static void ResetPosition()
{
    Undo.RecordObject(Selection.activeTransform, "Reset Position");
    Selection.activeTransform.position = Vector3.zero;
}

GameObject creation (use priority 10):

[MenuItem("GameObject/Custom/My Object", false, 10)]
static void CreateMyObject(MenuCommand menuCommand)
{
    var go = new GameObject("My Object");
    GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
    Undo.RegisterCreatedObjectUndo(go, "Create My Object");
    Selection.activeObject = go;
}

Gizmos and Handles

Gizmos -- Visual Debugging in Scene/Game View

All drawing inside OnDrawGizmos() (always) or OnDrawGizmosSelected() (when selected):

void OnDrawGizmos()
{
    Gizmos.color = Color.yellow;
    Gizmos.DrawWireSphere(transform.position, radius);
}

void OnDrawGizmosSelected()
{
    Gizmos.color = Color.red;
    Gizmos.DrawSphere(transform.position, radius);
}

Methods: DrawLine, DrawRay, DrawSphere, DrawWireSphere, DrawCube, DrawWireCube, DrawMesh, DrawWireMesh, DrawFrustum, DrawIcon. Properties: color, matrix.

Handles -- Interactive 3D Controls (Editor Only)

Used inside OnSceneGUI() on custom Editors:

[CustomEditor(typeof(CircleLayout))]
public class CircleLayoutEditor : Editor
{
    public void OnSceneGUI()
    {
        var t = (CircleLayout)target;
        Handles.color = new Color(1f, 0.8f, 0.4f, 1f);
        Handles.DrawWireDisc(t.transform.position, t.transform.up, t.radius);
        Handles.Label(t.transform.position, $"Radius: {t.radius:F1}");

        EditorGUI.BeginChangeCheck();
        float newRadius = Handles.RadiusHandle(Quaternion.identity, t.transform.position, t.radius);
        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(t, "Change Radius");
            t.radius = newRadius;
        }
    }
}

Methods: PositionHandle, RotationHandle, ScaleHandle, FreeMoveHandle, RadiusHandle, DrawLine, DrawWireDisc, Label, BeginGUI/EndGUI. Properties: color, matrix.


SerializedObject Pattern

The standard way to edit properties in editor scripts. Provides automatic Undo, multi-object editing, and prefab override tracking.

Three-step pattern:

serializedObject.Update();                                          // 1. Sync from target
EditorGUILayout.PropertyField(serializedObject.FindProperty("myField")); // 2. Draw/modify
serializedObject.ApplyModifiedProperties();                         // 3. Apply with undo
MemberDescription
Update()Refresh from target
ApplyModifiedProperties()Commit changes with undo
FindProperty(string)Get SerializedProperty by name
GetIterator()Iterate all properties
targetObject / targetObjectsInspected object(s)
hasModifiedPropertiesTrue when unapplied changes exist

For multi-object editing: add [CanEditMultipleObjects] and always use SerializedProperty instead of target.


AssetDatabase

Programmatic asset access in editor scripts.

// Create
var data = ScriptableObject.CreateInstance<MyData>();
AssetDatabase.CreateAsset(data, "Assets/Data/MyData.asset");
AssetDatabase.SaveAssets();

// Load
var loaded = AssetDatabase.LoadAssetAtPath<MyData>("Assets/Data/MyData.asset");

// Find by type
string[] guids = AssetDatabase.FindAssets("t:MyData");
foreach (string guid in guids)
{
    string path = AssetDatabase.GUIDToAssetPath(guid);
    var asset = AssetDatabase.LoadAssetAtPath<MyData>(path);
}

// Other operations
AssetDatabase.GetAssetPath(myObject);
AssetDatabase.DeleteAsset("Assets/Data/OldData.asset");
AssetDatabase.Refresh();

Key methods: CreateAsset, LoadAssetAtPath<T>, FindAssets, GetAssetPath, AssetPathToGUID/GUIDToAssetPath, SaveAssets, Refresh, DeleteAsset, CopyAsset, MoveAsset, RenameAsset, ImportAsset.


Common Patterns

// Editor-only guard
#if UNITY_EDITOR
using UnityEditor;
// editor code
#endif

// Change detection
EditorGUI.BeginChangeCheck();
// ... controls ...
if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(target, "Change"); }

// ScriptableObject creation menu
[CreateAssetMenu(fileName = "NewConfig", menuName = "Game/Config Data", order = 1)]
public class ConfigData : ScriptableObject { public float moveSpeed = 5f; }

// Default inspector + extras
[CustomEditor(typeof(MyComponent))]
public class MyComponentEditor : Editor
{
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        if (GUILayout.Button("Do Something")) { ((MyComponent)target).DoSomething(); }
    }
}

Anti-Patterns

Anti-PatternProblemFix
Editing target without UndoNo undo, no dirty flagUse SerializedObject or Undo.RecordObject()
target with [CanEditMultipleObjects]Only modifies first objectUse SerializedProperty
Editor code outside Editor/ without #if UNITY_EDITORBuild failuresUse Editor/ folder or preprocessor guard
EditorGUILayout in PropertyDrawerNot supportedUse EditorGUI with Rect
Missing serializedObject.Update()Stale dataAlways call before reading
Missing ApplyModifiedProperties()Changes lostAlways call after modifications
Mixing UI Toolkit + IMGUI in one PropertyDrawerNot supportedChoose one framework
Missing Undo.RegisterCreatedObjectUndo()Cannot undo creationAlways register new objects
Missing GameObjectUtility.SetParentAndAlign()Wrong hierarchy parentingUse in GameObject menu items
Heavy work in OnInspectorGUI()/OnGUI()Lag (called many times/frame)Cache in OnEnable()

Key API Quick Reference

Editor:        [CustomEditor(typeof(T))], [CanEditMultipleObjects]
               CreateInspectorGUI(), OnInspectorGUI(), OnSceneGUI()
               DrawDefaultInspector(), target, targets, serializedObject

EditorWindow:  GetWindow<T>(), CreateWindow<T>(), CreateGUI(), OnGUI()
               rootVisualElement, titleContent, Show/ShowUtility/ShowModal

PropertyDrawer: [CustomPropertyDrawer(typeof(T))]
               CreatePropertyGUI(), OnGUI(rect,prop,label), GetPropertyHeight()
               attribute, fieldInfo, preferredLabel

SerializedObject: Update(), ApplyModifiedProperties(), FindProperty()
MenuItem:      [MenuItem("Path", validate, priority)], % # & ^ _ shortcuts
Gizmos:        DrawLine/Sphere/WireSphere/Cube/WireCube/Ray/Mesh/Icon, color, matrix
Handles:       PositionHandle/RotationHandle/ScaleHandle/FreeMoveHandle/RadiusHandle
               DrawLine/DrawWireDisc/Label, BeginGUI/EndGUI, color, matrix
AssetDatabase: CreateAsset, LoadAssetAtPath<T>, FindAssets, SaveAssets, Refresh

Related Skills

  • unity-foundations -- Project structure, assembly definitions, Editor folders
  • unity-scripting -- MonoBehaviour lifecycle, SerializeField, ScriptableObject
  • unity-ui -- UI Toolkit fundamentals, VisualElement, UXML, USS

Additional Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.96%
按下载量换算43

Claude

27.84%
按下载量换算35

Cursor

19.3%
按下载量换算24

Gemini CLI

10.23%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills