Token导航 LogoToken导航

Agent Skill · 研究检索

unity-fundamentals(Unity fundamentals 搜索)

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

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

总安装 3,382周安装 86GitHub Stars 3下载 934核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/cryptorabea/claude_unity_dev_plugin --skill 'Unity Fundamentals'

这个 Skill 是做什么的

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

用于 Unity 基础概念和开发流程的信息查找、检索和筛选,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位基础资料。适用于需要根据关键词或学习场景定位候选结果时使用。通过 npx skills add 命令从 GitHub 仓库安装并使用。

安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。unity-fundamentals 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/unity-fundamentals

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

unity-fundamentals 怎么安装?

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

unity-fundamentals 支持哪些 AI 工具?

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

unity-fundamentals 需要什么权限?

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

unity-fundamentals 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

unity-fundamentals 用的人多吗?

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

unity-fundamentals 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 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-fundamentals

Unity fundamentals 搜索 · 本页

3,3823只读MIT通过

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

SKILL.md 原文

Unity Fundamentals

Comprehensive guidance on Unity's core systems, MonoBehaviour lifecycle, serialization, component architecture, and prefab workflows.

Overview

Unity development centers around MonoBehaviour components, the Component pattern, and a specific lifecycle of callback methods. Understanding these fundamentals is critical for writing correct, performant Unity code. This skill covers:

  • MonoBehaviour lifecycle methods and their proper usage
  • Serialization system and Inspector integration
  • Component-based architecture and GetComponent patterns
  • Prefab workflows and best practices

MonoBehaviour Lifecycle

Unity calls specific methods on MonoBehaviour scripts in a predetermined order. Using the wrong method leads to bugs, null references, and poor performance.

Initialization Methods

Awake()

Called when the script instance loads, before any Start() calls. Use for initializing this object's state.

private void Awake()
{
    // Cache component references on THIS GameObject
    rigidbody = GetComponent<Rigidbody>();
    animator = GetComponent<Animator>();

    // Initialize private state
    currentHealth = maxHealth;
    inventory = new List<Item>();

    // DON'T reference other objects - they may not be initialized yet
}

Use Awake() for:

  • Caching component references
  • Initializing private fields
  • Setting up internal state
  • Creating singletons/managers

Don't use Awake() for:

  • Referencing other GameObjects (use Start instead)
  • Performing operations that depend on other scripts being ready
Start()

Called before the first Update(), after all Awake() calls complete. Use for setup that references other objects.

private void Start()
{
    // Safe to reference other GameObjects - they're initialized
    playerTransform = GameObject.FindWithTag("Player").transform;
    gameManager = FindObjectOfType<GameManager>();

    // Register with managers or systems
    GameManager.Instance.RegisterEnemy(this);

    // Perform initialization that depends on other components
    SetupWeapon(gameManager.GetStartingWeapon());
}

Use Start() for:

  • Finding and referencing other GameObjects
  • Calling initialization methods on other components
  • Registering with managers or systems
  • Setup that depends on scene being fully initialized

Common Pattern:

private Camera mainCamera;  // Cache in Awake
private Transform target;    // Find in Start

private void Awake()
{
    mainCamera = Camera.main;  // Cache expensive lookup
}

private void Start()
{
    target = GameObject.FindWithTag("Target").transform;  // Find after scene loads
}
OnEnable() / OnDisable()

Called when GameObject becomes active/inactive. Use for subscribing/unsubscribing from events.

private void OnEnable()
{
    // Subscribe to events
    GameEvents.OnPlayerDied += HandlePlayerDeath;
    InputManager.OnJumpPressed += HandleJump;

    // Re-enable functionality
    StartCoroutine(SpawnEnemies());
}

private void OnDisable()
{
    // Unsubscribe from events (prevents memory leaks!)
    GameEvents.OnPlayerDied -= HandlePlayerDeath;
    InputManager.OnJumpPressed -= HandleJump;

    // Clean up temporary state
    StopAllCoroutines();
}

Critical: Always unsubscribe in OnDisable() to prevent memory leaks.

Update Methods

Update()

Called every frame. Use sparingly - performance critical.

private void Update()
{
    // Input handling
    if (Input.GetKeyDown(KeyCode.Space))
        Jump();

    // Frame-dependent logic
    UpdateUI();

    // AVOID expensive operations here
    // DON'T call GetComponent every frame
    // DON'T use Find methods
}

Avoid Update() when possible. Prefer event-driven approaches.

FixedUpdate()

Called at fixed timestep (default 50 FPS). Use for physics operations only.

private void FixedUpdate()
{
    // Physics operations
    rigidbody.AddForce(moveDirection * moveSpeed);

    // Physics-based movement
    rigidbody.MovePosition(transform.position + velocity * Time.fixedDeltaTime);

    // DON'T handle input here (use Update)
    // DON'T update UI here (use Update or LateUpdate)
}

Rule: If it touches Rigidbody or physics, use FixedUpdate(). Everything else uses Update() or event-driven approaches.

LateUpdate()

Called after all Update() calls. Use for camera follow and final adjustments.

private void LateUpdate()
{
    // Camera follow (after player moved in Update)
    transform.position = target.position + offset;

    // Final position adjustments
    ClampToBounds();

    // UI updates that depend on world state
    UpdateHealthBar();
}

Destruction Methods

OnDestroy()

Called when GameObject is destroyed. Use for final cleanup.

private void OnDestroy()
{
    // Unsubscribe from static events
    GameEvents.OnPlayerDied -= HandlePlayerDeath;

    // Release resources
    if (texture != null)
        Destroy(texture);

    // Notify other systems
    GameManager.Instance.UnregisterEnemy(this);
}

Lifecycle Order Summary

  1. Awake() - Initialize self
  2. OnEnable() - Subscribe to events
  3. Start() - Reference others, final setup
  4. FixedUpdate() - Physics (50 FPS)
  5. Update() - Per-frame logic (variable FPS)
  6. LateUpdate() - Camera, final adjustments
  7. OnDisable() - Unsubscribe from events
  8. OnDestroy() - Final cleanup

Serialization System

Unity's serialization system controls what appears in the Inspector and how data persists.

Serialized Fields

Make private fields editable in Inspector:

[SerializeField] private int maxHealth = 100;
[SerializeField] private float moveSpeed = 5f;
[SerializeField] private GameObject prefab;

Benefits:

  • Keeps encapsulation (private access)
  • Inspector editing
  • Prefab/scene data persistence

Best Practice: Prefer [SerializeField] private over public fields.

Header and Tooltip

Organize Inspector sections:

[Header("Movement Settings")]
[Tooltip("Maximum movement speed in units per second")]
[SerializeField] private float moveSpeed = 5f;

[Tooltip("Rotation speed in degrees per second")]
[SerializeField] private float rotationSpeed = 180f;

[Header("Combat Settings")]
[SerializeField] private int attackDamage = 25;

Serialization Rules

What Unity serializes:

  • Public fields (unless [HideInInspector])
  • Private fields with [SerializeField]
  • Supported types: primitives, Unity objects, structs, arrays, Lists

What Unity doesn't serialize:

  • Properties
  • Private fields without [SerializeField]
  • Dictionaries
  • Interfaces
  • Static fields

Properties vs Serialized Fields

// DON'T expose internal state directly
public int health;  // Bad: public field

// DO use properties for controlled access
[SerializeField] private int health = 100;
public int Health
{
    get => health;
    set
    {
        health = Mathf.Clamp(value, 0, maxHealth);
        OnHealthChanged?.Invoke(health);
    }
}

Component Architecture

Unity uses the Component pattern - functionality composed from multiple components.

GetComponent Pattern

Cache references in Awake() to avoid repeated lookups:

// ❌ BAD - Repeated GetComponent calls
private void Update()
{
    GetComponent<Rigidbody>().velocity = Vector3.forward;  // Expensive!
}

// ✅ GOOD - Cache once
private Rigidbody rb;

private void Awake()
{
    rb = GetComponent<Rigidbody>();
}

private void Update()
{
    rb.velocity = Vector3.forward;  // Fast
}

Component Variations

// GetComponent<T>() - On this GameObject
rb = GetComponent<Rigidbody>();

// GetComponentInChildren<T>() - This GameObject and children
animator = GetComponentInChildren<Animator>();

// GetComponentInParent<T>() - This GameObject and parents
canvas = GetComponentInParent<Canvas>();

// GetComponents<T>() - Multiple components
Collider[] colliders = GetComponents<Collider>();

Performance: Cache all GetComponent results. Never call in Update/FixedUpdate.

Required Components

Declare component dependencies:

[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(Collider))]
public class PlayerMovement : MonoBehaviour
{
    private Rigidbody rb;

    private void Awake()
    {
        rb = GetComponent<Rigidbody>();  // Guaranteed to exist
    }
}

Component Communication

Direct Reference (Inspector):

[SerializeField] private HealthDisplay healthDisplay;

private void TakeDamage(int amount)
{
    health -= amount;
    healthDisplay.UpdateHealth(health);  // Direct call
}

GetComponent (Runtime):

private void OnTriggerEnter(Collider other)
{
    var health = other.GetComponent<Health>();
    if (health != null)
        health.TakeDamage(10);
}

Events (Decoupled):

public event Action<int> OnHealthChanged;

private void TakeDamage(int amount)
{
    health -= amount;
    OnHealthChanged?.Invoke(health);  // Any subscribers get notified
}

Prefab Workflows

Prefabs are reusable GameObject templates. Understanding prefab workflows prevents common issues.

Creating Prefabs

Drag GameObject from Hierarchy to Project window. Blue text in Hierarchy indicates prefab instance.

Prefab Instances

Changes to prefab instances:

  • Override - Changes to this instance only (bold blue)
  • Apply - Push changes to prefab asset (affects all instances)
  • Revert - Discard instance changes, match prefab

Prefab Variants

Create variations of a base prefab:

Base Prefab: Enemy
├── Variant: FastEnemy (increased speed)
├── Variant: TankEnemy (increased health)
└── Variant: FlyingEnemy (added flight)

Changes to base prefab propagate to variants.

Nested Prefabs

Prefabs can contain other prefabs:

Car Prefab
├── Wheel Prefab (x4)
├── Engine Prefab
└── Door Prefab (x4)

Edit nested prefabs independently.

Programmatic Prefab Usage

[SerializeField] private GameObject enemyPrefab;
[SerializeField] private Transform spawnPoint;

private void SpawnEnemy()
{
    // Instantiate prefab
    GameObject enemy = Instantiate(enemyPrefab, spawnPoint.position, Quaternion.identity);

    // Configure instance
    enemy.GetComponent<Enemy>().SetTarget(player);

    // Parent to container (optional)
    enemy.transform.SetParent(enemyContainer);
}

Prefab Best Practices

  1. Use prefabs for anything spawned at runtime (enemies, projectiles, UI panels)
  2. Create prefab variants instead of duplicating prefabs
  3. Apply changes carefully - affects all instances
  4. Keep prefabs in organized folders - Prefabs/Characters, Prefabs/UI, etc.
  5. Test prefab changes before applying to all instances

Common Patterns

Singleton Manager

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

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

        Instance = this;
        DontDestroyOnLoad(gameObject);
    }
}

Object Initialization

public class Enemy : MonoBehaviour
{
    [SerializeField] private int health = 100;

    private Rigidbody rb;
    private Transform target;

    // 1. Cache components on self
    private void Awake()
    {
        rb = GetComponent<Rigidbody>();
    }

    // 2. Find external references
    private void Start()
    {
        target = GameObject.FindWithTag("Player").transform;
    }

    // 3. Subscribe to events
    private void OnEnable()
    {
        GameEvents.OnWaveComplete += HandleWaveComplete;
    }

    // 4. Unsubscribe from events
    private void OnDisable()
    {
        GameEvents.OnWaveComplete -= HandleWaveComplete;
    }
}

Additional Resources

Reference Files

For detailed guidance on specific topics:

  • references/lifecycle-detailed.md - Complete lifecycle method reference
  • references/serialization-guide.md - Advanced serialization patterns
  • references/component-patterns.md - Component architecture best practices
  • references/prefab-workflows.md - Comprehensive prefab usage guide

Quick Reference

Lifecycle Order: Awake → OnEnable → Start → FixedUpdate → Update → LateUpdate → OnDisable → OnDestroy

Serialization: [SerializeField] private over public

Components: Cache in Awake(), never call GetComponent in Update()

Prefabs: Use for reusable objects, test before applying changes


Follow these fundamentals to build solid Unity projects that are performant, maintainable, and bug-free.

平台分布

Claude Code

28.43%
按下载量换算266

Antigravity

25.54%
按下载量换算239

windsurf

17.25%
按下载量换算161

OpenCode

12.21%
按下载量换算114

Codex

7.77%
按下载量换算73

Gemini CLI

3.25%
按下载量换算30

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills