Token导航 LogoToken导航

Agent Skill · 研究检索

unity(Unity 搜索)

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

unity 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 67,870。

总安装 240周安装 10GitHub Stars 8下载 80核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/ar4mirez/samuel --skill unity

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

unity 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。适用于 Unity 2022 LTS+ 游戏开发、VR/AR 应用和交互式媒体项目,基于 C# 和组件化架构。

通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。当前无详细 SKILL.md 内容,需参考仓库中的 Unity Guide 了解 MonoBehaviour 设计规范和性能优化。

来源仓库内路径:skills/unity

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/ar4mirez/samuel --skill unity;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

unity 怎么安装?

在终端执行 npx skills add https://github.com/ar4mirez/samuel --skill unity。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

unity 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

unity 需要什么权限?

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

unity 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

unity 用的人多吗?

公开数据是累计安装 240 次,近一周安装 10 次,下载 80 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

unity 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
unity

Unity 搜索 · 本页

2408只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Unity Guide

Applies to: Unity 2022 LTS+, C#, Games, VR/AR, Simulations, Interactive Media

Core Principles

  1. Component-Based Architecture: One MonoBehaviour = one responsibility
  2. Composition Over Inheritance: Combine components on GameObjects; avoid deep class hierarchies
  3. Data-Driven Design: Use ScriptableObjects for configuration and shared data
  4. Event-Driven Communication: Decouple systems with C# events, UnityEvents, or ScriptableObject events
  5. Cache Everything: Never call Find, GetComponent, or allocate in Update

Guardrails

MonoBehaviour Rules

  • Keep Update() bodies under 20 lines; delegate to focused methods
  • Cache all GetComponent results in Awake() (never call in Update)
  • Subscribe to events in OnEnable, unsubscribe in OnDisable
  • Use [SerializeField] private instead of public for inspector fields
  • Apply [RequireComponent] attribute when a script depends on another component
  • Never use GameObject.Find or FindObjectOfType at runtime (cache in Start/Awake)
  • Use CompareTag("Tag") instead of gameObject.tag == "Tag" (avoids GC allocation)

Project Organization

  • Prefix project folder with _Project/ to keep it at top of Assets
  • Group assets by feature, not by type (e.g., Player/ contains scripts, prefabs, materials)
  • Keep Resources/ minimal; prefer Addressables for runtime asset loading
  • Store all runtime configuration in ScriptableObjects under _Project/ScriptableObjects/
  • Place editor-only scripts inside Editor/ folders

Performance

  • Object pool frequently spawned objects (bullets, particles, enemies)
  • Avoid allocations in hot paths (Update, FixedUpdate, physics callbacks)
  • Reuse collections instead of creating new ones each frame
  • Use StringBuilder for string operations; never concatenate in loops
  • Prefer value types (struct) for small, short-lived data
  • Set physics layers properly; disable unnecessary collision pairs in Physics settings
  • Use Time.deltaTime for frame-independent movement, Time.fixedDeltaTime in FixedUpdate

Naming Conventions

  • Scripts: PascalCase.cs matching the class name (e.g., PlayerController.cs)
  • Private fields: camelCase (e.g., moveSpeed, jumpHeight)
  • Serialized fields: prefix with [Header("Section")] for inspector grouping
  • Interfaces: IPrefixed (e.g., IDamageable, IInteractable)
  • ScriptableObjects: PascalCase with descriptive asset menu name
  • Scenes: PascalCase (e.g., MainMenu.unity, Level01.unity)
  • Prefabs: PascalCase matching the primary component (e.g., EnemyGoblin.prefab)

Project Structure

MyGame/
├── Assets/
│   ├── _Project/
│   │   ├── Art/                    # Materials, Models, Sprites, Textures
│   │   ├── Audio/                  # Music, SFX
│   │   ├── Prefabs/                # Characters, Environment, UI
│   │   ├── Scenes/
│   │   ├── Scripts/
│   │   │   ├── Core/              # GameManager, SceneLoader, ServiceLocator
│   │   │   ├── Player/            # PlayerController, PlayerHealth, PlayerInput
│   │   │   ├── Enemies/           # AI, spawning, enemy types
│   │   │   ├── UI/                # HUD, menus, dialogs
│   │   │   ├── Systems/           # Audio, save, pooling, events
│   │   │   └── Data/              # ScriptableObjects, serializable structs
│   │   ├── ScriptableObjects/     # Items, Enemies, Settings assets
│   │   └── Settings/              # InputActions.inputactions
│   ├── Plugins/
│   └── Resources/                  # Keep minimal; prefer Addressables
├── Packages/manifest.json
├── ProjectSettings/
├── Tests/                          # EditMode/ and PlayMode/
└── .gitignore

MonoBehaviour Lifecycle

Understanding execution order is critical for correct initialization.

public class LifecycleExample : MonoBehaviour
{
    // INITIALIZATION (called once)
    private void Awake()    { /* Cache components, init self. Runs even if disabled. */ }
    private void OnEnable() { /* Subscribe to events. Runs when enabled. */ }
    private void Start()    { /* Cross-object setup. Runs before first Update, only if enabled. */ }

    // UPDATE LOOP (called every frame/tick)
    private void Update()      { /* Game logic, input. Use Time.deltaTime. */ }
    private void FixedUpdate() { /* Physics. Constant timestep. Rigidbody movement here. */ }
    private void LateUpdate()  { /* Camera follow, post-processing. After all Updates. */ }

    // CLEANUP
    private void OnDisable()  { /* Unsubscribe events. */ }
    private void OnDestroy()  { /* Final cleanup. */ }
}

Key rules: Awake initializes self-references. Start accesses other objects. OnEnable/OnDisable always pair event subscriptions. Physics in FixedUpdate only.

Component Patterns

Singleton (DontDestroyOnLoad)

public class GameManager : MonoBehaviour
{
    public static GameManager Instance { get; private set; }

    public GameState CurrentState { get; private set; }
    public event System.Action<GameState> OnStateChanged;

    private void Awake()
    {
        if (Instance != null && Instance != this) { Destroy(gameObject); return; }
        Instance = this;
        DontDestroyOnLoad(gameObject);
    }

    public void SetState(GameState state)
    {
        if (CurrentState == state) return;
        CurrentState = state;
        OnStateChanged?.Invoke(state);
    }
}

Use singletons sparingly. Prefer Service Locator or dependency injection for testability.

Service Locator

public static class ServiceLocator
{
    private static readonly Dictionary<Type, object> Services = new();

    public static void Register<T>(T service) where T : class
        => Services[typeof(T)] = service;

    public static T Get<T>() where T : class
        => Services.TryGetValue(typeof(T), out var s) ? s as T : null;

    public static void Clear() => Services.Clear();
}

// Register in bootstrapper Awake(), resolve anywhere

Health / Damageable Interface

public interface IDamageable
{
    void TakeDamage(int amount);
    bool IsAlive { get; }
}

public class Health : MonoBehaviour, IDamageable
{
    [SerializeField] private int maxHealth = 100;
    public int Current { get; private set; }
    public bool IsAlive => Current > 0;

    public UnityEvent<int, int> OnHealthChanged; // current, max
    public UnityEvent OnDeath;

    private void Start() { Current = maxHealth; OnHealthChanged?.Invoke(Current, maxHealth); }

    public void TakeDamage(int amount)
    {
        if (!IsAlive) return;
        Current = Mathf.Max(0, Current - amount);
        OnHealthChanged?.Invoke(Current, maxHealth);
        if (Current <= 0) OnDeath?.Invoke();
    }

    public void Heal(int amount)
    {
        if (!IsAlive) return;
        Current = Mathf.Min(maxHealth, Current + amount);
        OnHealthChanged?.Invoke(Current, maxHealth);
    }
}

Input Handling (New Input System)

[RequireComponent(typeof(CharacterController))]
public class PlayerController : MonoBehaviour
{
    [Header("Movement")]
    [SerializeField] private float moveSpeed = 5f;
    [SerializeField] private float jumpHeight = 2f;
    [SerializeField] private float gravity = -15f;

    private CharacterController controller;
    private PlayerInput playerInput;
    private Vector2 moveInput;
    private Vector3 velocity;

    private void Awake()
    {
        controller = GetComponent<CharacterController>();
        playerInput = GetComponent<PlayerInput>();
    }

    private void OnEnable()
    {
        playerInput.actions["Move"].performed += ctx => moveInput = ctx.ReadValue<Vector2>();
        playerInput.actions["Move"].canceled += ctx => moveInput = Vector2.zero;
        playerInput.actions["Jump"].performed += _ => TryJump();
    }

    private void Update() => HandleMovement();

    private void HandleMovement()
    {
        if (controller.isGrounded && velocity.y < 0) velocity.y = -2f;

        var move = (transform.forward * moveInput.y + transform.right * moveInput.x) * moveSpeed;
        velocity.y += gravity * Time.deltaTime;
        controller.Move((move + velocity) * Time.deltaTime);
    }

    private void TryJump()
    {
        if (controller.isGrounded)
            velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity);
    }
}

Always use the new Input System package. Define actions in .inputactions asset, not hardcoded KeyCode checks.

Physics Basics

// Move Rigidbody in FixedUpdate only
private void FixedUpdate()
{
    rb.MovePosition(rb.position + moveDirection * speed * Time.fixedDeltaTime);
}

// Collision detection (requires Collider + Rigidbody on at least one)
private void OnCollisionEnter(Collision collision)
{
    if (collision.gameObject.CompareTag("Enemy"))
    {
        var damageable = collision.gameObject.GetComponent<IDamageable>();
        damageable?.TakeDamage(10);
    }
}

// Trigger detection (Collider with isTrigger = true)
private void OnTriggerEnter(Collider other)
{
    if (other.CompareTag("Pickup"))
        CollectItem(other.gameObject);
}

Rules: Rigidbody movement in FixedUpdate. Use layers to filter collisions. Prefer CompareTag over string comparison. Set Rigidbody interpolation for smooth rendering.

UI / Canvas

public class HUDController : MonoBehaviour
{
    [Header("Health")]
    [SerializeField] private Slider healthBar;
    [SerializeField] private TextMeshProUGUI healthText;

    [Header("Score")]
    [SerializeField] private TextMeshProUGUI scoreText;

    public void UpdateHealth(int current, int max)
    {
        healthBar.value = (float)current / max;
        healthText.text = $"{current}/{max}";
    }

    public void UpdateScore(int score) => scoreText.text = score.ToString("N0");
}

UI guidelines: Use TextMeshPro for all text (never legacy UI.Text). Anchor UI elements properly for responsive layouts. Use Canvas Groups for fade effects. Keep UI logic in dedicated controllers, not game logic scripts.

ScriptableObjects

[CreateAssetMenu(fileName = "New Item", menuName = "Game/Items/Item Data")]
public class ItemData : ScriptableObject
{
    [Header("Basic Info")]
    public string itemName;
    [TextArea(3, 5)] public string description;
    public Sprite icon;
    public ItemType itemType;
    public Rarity rarity;

    [Header("Properties")]
    public int maxStack = 99;
    public int buyPrice;
    public int sellPrice;
}

Use ScriptableObjects for: item definitions, enemy configs, game settings, event channels, audio libraries. They live as .asset files, are editable in the Inspector, and shared across scenes without singletons.

ScriptableObject Event Channel

[CreateAssetMenu(menuName = "Game/Events/Game Event")]
public class GameEvent : ScriptableObject
{
    private readonly List<System.Action> listeners = new();

    public void Raise() { for (int i = listeners.Count - 1; i >= 0; i--) listeners[i](); }
    public void Register(System.Action listener) => listeners.Add(listener);
    public void Unregister(System.Action listener) => listeners.Remove(listener);
}

Wire listeners in OnEnable/OnDisable. This decouples systems completely -- the publisher does not know about subscribers.

Object Pooling

public class ObjectPool<T> where T : Component
{
    private readonly T prefab;
    private readonly Transform parent;
    private readonly Queue<T> pool = new();

    public ObjectPool(T prefab, Transform parent, int initialSize)
    {
        this.prefab = prefab;
        this.parent = parent;
        for (int i = 0; i < initialSize; i++) pool.Enqueue(CreateInstance());
    }

    public T Get(Vector3 pos, Quaternion rot)
    {
        var obj = pool.Count > 0 ? pool.Dequeue() : CreateInstance();
        obj.transform.SetPositionAndRotation(pos, rot);
        obj.gameObject.SetActive(true);
        return obj;
    }

    public void Return(T obj) { obj.gameObject.SetActive(false); pool.Enqueue(obj); }

    private T CreateInstance()
    {
        var obj = Object.Instantiate(prefab, parent);
        obj.gameObject.SetActive(false);
        return obj;
    }
}

Pool bullets, particles, enemies -- anything spawned frequently. Never call Instantiate/Destroy in tight loops.

Testing

Edit Mode Tests (Pure Logic)

using NUnit.Framework;

[TestFixture]
public class InventoryTests
{
    [Test]
    public void AddItem_WhenSlotAvailable_ReturnsTrue()
    {
        var inventory = new Inventory(maxSlots: 10);
        Assert.IsTrue(inventory.AddItem(itemData, quantity: 1));
    }

    [Test]
    public void AddItem_WhenFull_ReturnsFalse()
    {
        var inventory = new Inventory(maxSlots: 0);
        Assert.IsFalse(inventory.AddItem(itemData, quantity: 1));
    }
}

Play Mode Tests (MonoBehaviour)

using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;

[TestFixture]
public class HealthTests
{
    [UnityTest]
    public IEnumerator TakeDamage_ReducesCurrentHealth()
    {
        var go = new GameObject();
        var health = go.AddComponent<Health>();
        yield return null; // Wait for Start()

        health.TakeDamage(25);
        Assert.AreEqual(75, health.Current);

        Object.Destroy(go);
    }
}

Testing rules: Edit Mode for pure logic (no MonoBehaviour dependency). Play Mode for component behavior that requires the Unity lifecycle. Always Destroy test GameObjects in TearDown or inline.

Commands

# Command-line build (macOS)
/Applications/Unity/Hub/Editor/2022.3.0f1/Unity.app/Contents/MacOS/Unity \
  -quit -batchmode -projectPath ~/Projects/MyGame \
  -buildTarget StandaloneOSX -buildPath Builds/macOS/MyGame.app

# Run Edit Mode tests
Unity -runTests -projectPath /path/to/project \
  -testResults results.xml -testPlatform EditMode

# Run Play Mode tests
Unity -runTests -projectPath /path/to/project \
  -testResults results.xml -testPlatform PlayMode

# Export package
Unity -exportPackage Assets/MyPlugin MyPlugin.unitypackage

Common Mistakes

// BAD: Finding objects every frame
void Update() { var player = GameObject.Find("Player"); }
// GOOD: Cache in Awake/Start
private Transform player;
void Awake() => player = GameObject.Find("Player").transform;

// BAD: String tag comparison (GC alloc)
if (gameObject.tag == "Player") { }
// GOOD: CompareTag (no allocation)
if (gameObject.CompareTag("Player")) { }

// BAD: Allocating in Update
void Update() { var list = new List<Enemy>(); }
// GOOD: Reuse collections
private readonly List<Enemy> enemies = new();
void Update() { enemies.Clear(); /* reuse */ }

// BAD: Moving Rigidbody in Update
void Update() { rb.MovePosition(target); }
// GOOD: Physics in FixedUpdate
void FixedUpdate() { rb.MovePosition(target); }

Advanced Topics

For detailed patterns and examples, see:

  • references/patterns.md -- Animation, networking, editor scripting, performance profiling, state machines, save systems, advanced pooling

External References

平台分布

Codex

38.48%
按下载量换算31

Claude

29.17%
按下载量换算23

Cursor

19.15%
按下载量换算15

Gemini CLI

11.12%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

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

安装前确认

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

继续浏览同类 Skills