Token导航 LogoToken导航

Agent Skill · 研究检索

unity-foundations(Unity foundations 搜索)

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

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

总安装 343周安装 14GitHub Stars 14下载 111核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

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

这个 Skill 是做什么的

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

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

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

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

unity-foundations 怎么安装?

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

unity-foundations 支持哪些 AI 工具?

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

unity-foundations 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

unity-foundations 是免费的吗?

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

unity-foundations 用的人多吗?

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

unity-foundations 安全吗?

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

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

值得选的地方

  • 同时适配 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-foundations

Unity foundations 搜索 · 本页

34314需要联网未明确通过

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

SKILL.md 原文

Unity Foundations

Core Concepts

GameObjects

GameObjects are the fundamental building blocks in Unity. Every object in a scene -- characters, props, scenery, cameras, lights -- is a GameObject. GameObjects are containers: they cannot function alone and require Components to gain functionality. Every GameObject automatically includes a Transform component that cannot be removed.

Components

Components are the functional pieces of every GameObject. Unity uses a composition-over-inheritance architecture: you build behavior by attaching multiple components to a GameObject rather than inheriting from deep class hierarchies. Each GameObject must have exactly one Transform component. Additional components (Rigidbody, Collider, MeshRenderer, custom MonoBehaviours) define what the object does.

Constraints from the docs:

  • Components must reside in the same project as their target GameObject
  • Components cannot be sourced from separate projects, unattached scripts, or uninstalled packages

Transforms

The Transform component stores position, rotation, and scale -- each relative to the parent (local coordinates) or to the world origin (world coordinates). Key points from the docs:

  • Child Transforms display values relative to their parent
  • Root GameObjects (no parent) show world coordinates
  • The physics engine assumes 1 unit = 1 meter
  • Set parent location to (0,0,0) before adding children so local coords match global coords
  • Avoid adjusting Transform Scale at runtime; model assets at real-life scale instead. Non-uniform scaling causes issues with Colliders, Lights, and Audio Sources

Scenes

Scenes are assets that contain all or part of a game or application. A default new scene includes a Camera and a directional Light. Projects can use a single scene or multiple scenes (e.g., one per level). Scene Templates serve as blueprints for creating new scenes.

Prefabs

Prefabs are reusable asset templates that store a complete GameObject configuration (all components, property values, and child GameObjects). Key features:

  • Nested Prefabs: Include prefab instances within other prefabs
  • Prefab Variants: Create predefined variations that maintain a base prefab relationship
  • Overrides: Modify components/data on specific instances without affecting the template
  • Unpacking: Convert prefab instances back to standalone GameObjects

ScriptableObjects

ScriptableObject is a serializable Unity type derived from UnityEngine.Object that serves as a data container independent of GameObjects. Unlike MonoBehaviours, ScriptableObjects exist as project-level .asset files. Primary use cases:

  • Shared data containers (reduces memory by referencing one asset instead of duplicating data across prefabs)
  • Editor tool foundations (EditorTool, EditorWindow derive from ScriptableObject)
  • Runtime configuration storage

Critical: Unity does not automatically save changes to a ScriptableObject made via script in Edit mode. You must call EditorUtility.SetDirty() after modifications.

Tags

Tags are reference identifiers assigned to GameObjects for scripting purposes. Each GameObject can have only one tag, but multiple GameObjects can share the same tag. Built-in tags: Untagged, Respawn, Finish, EditorOnly, MainCamera, Player, GameController.

  • MainCamera: The Editor caches these; Camera.main returns the first valid result
  • EditorOnly: GameObjects tagged this way are destroyed during builds
  • Tag names cannot be renamed once created

Layers

Layers separate GameObjects for selective processing including camera rendering, lighting, physics collisions, and custom code logic. Unity supports up to 32 layers. LayerMasks define which layers an API call interacts with.


Common Patterns

Creating and Accessing Components

using UnityEngine;

public class ComponentAccess : MonoBehaviour
{
    void Start()
    {
        // Get a component on this GameObject
        Rigidbody rb = GetComponent<Rigidbody>();

        // Get a component on a child GameObject
        Collider childCollider = GetComponentInChildren<Collider>();

        // Get all components of a type on this and children
        MeshRenderer[] renderers = GetComponentsInChildren<MeshRenderer>();

        // Add a component at runtime
        BoxCollider box = gameObject.AddComponent<BoxCollider>();

        // Remove a component (destroys it)
        Destroy(box);
    }
}

Finding GameObjects

using UnityEngine;

public class FindingObjects : MonoBehaviour
{
    void Start()
    {
        // Find by tag (returns first match)
        GameObject player = GameObject.FindWithTag("Player");

        // Find all with tag
        GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy");

        // Find by name (slow -- avoid in Update)
        GameObject manager = GameObject.Find("GameManager");

        // Compare tags efficiently (no GC allocation)
        if (gameObject.CompareTag("Player"))
        {
            Debug.Log("This is the player");
        }
    }
}

Instantiating Prefabs

From the Unity docs example:

using UnityEngine;

public class InstantiationExample : MonoBehaviour
{
    // Reference to the prefab. Drag a prefab into this field in the Inspector.
    public GameObject myPrefab;

    void Start()
    {
        // Instantiate at position (0, 0, 0) and zero rotation.
        Instantiate(myPrefab, new Vector3(0, 0, 0), Quaternion.identity);
    }
}

Instantiating with Parent Transform

using UnityEngine;

public class SpawnWithParent : MonoBehaviour
{
    public GameObject prefab;
    public Transform parentTransform;

    void SpawnChild()
    {
        // Instantiate as child of a parent transform
        GameObject instance = Instantiate(prefab, parentTransform);

        // Instantiate at specific world position under a parent
        GameObject positioned = Instantiate(
            prefab,
            new Vector3(5, 0, 0),
            Quaternion.identity,
            parentTransform
        );
    }
}

ScriptableObject Data Container

From the Unity docs:

using UnityEngine;

[CreateAssetMenu(fileName = "Data", menuName = "ScriptableObjects/SpawnData", order = 1)]
public class SpawnDataScriptableObject : ScriptableObject
{
    public GameObject prefab;
    public int count;
    public Vector3[] positions;
}
using UnityEngine;

public class SpawnManager : MonoBehaviour
{
    public SpawnDataScriptableObject spawnData;

    void Start()
    {
        for (int i = 0; i < spawnData.count; i++)
        {
            Instantiate(spawnData.prefab, spawnData.positions[i], Quaternion.identity);
        }
    }
}

Scene Management

using UnityEngine;
using UnityEngine.SceneManagement;

public class SceneLoader : MonoBehaviour
{
    void Start()
    {
        // Subscribe to scene loaded event
        SceneManager.sceneLoaded += OnSceneLoaded;
    }

    void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        Debug.Log("Loaded: " + scene.name);
    }

    public void LoadLevel(string sceneName)
    {
        // Load scene by name (replaces current)
        SceneManager.LoadScene(sceneName);
    }

    public void LoadAdditive(string sceneName)
    {
        // Load scene additively (keeps current scenes)
        SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive);
    }

    public void UnloadLevel(string sceneName)
    {
        SceneManager.UnloadSceneAsync(sceneName);
    }

    public void GetSceneInfo()
    {
        Scene active = SceneManager.GetActiveScene();
        Debug.Log("Active scene: " + active.name);
        Debug.Log("Loaded scene count: " + SceneManager.loadedSceneCount);
    }
}

Tag-Based Spawning

From the Unity docs example:

using UnityEngine;

public class RespawnSystem : MonoBehaviour
{
    public GameObject respawnPrefab;
    private GameObject respawn;

    void Update()
    {
        if (respawn == null)
            respawn = GameObject.FindWithTag("Respawn");

        if (respawn != null)
        {
            Instantiate(respawnPrefab, respawn.transform.position,
                respawn.transform.rotation);
        }
    }
}

Activating and Deactivating GameObjects

using UnityEngine;

public class ToggleVisibility : MonoBehaviour
{
    public GameObject target;

    public void Toggle()
    {
        // SetActive controls whether the GameObject is active
        target.SetActive(!target.activeSelf);

        // activeSelf: this object's own active state
        // activeInHierarchy: effective state (considers parent chain)
        Debug.Log("Self: " + target.activeSelf);
        Debug.Log("InHierarchy: " + target.activeInHierarchy);
    }
}

Layer Masks for Raycasting

using UnityEngine;

public class LayerRaycast : MonoBehaviour
{
    void Update()
    {
        // Create a layer mask for layer named "Ground"
        int groundLayer = LayerMask.NameToLayer("Ground");
        int layerMask = 1 << groundLayer;

        // Raycast only against the Ground layer
        if (Physics.Raycast(transform.position, Vector3.down, out RaycastHit hit, 100f, layerMask))
        {
            Debug.Log("Hit ground at: " + hit.point);
        }

        // Use GetMask for multiple layers
        int combinedMask = LayerMask.GetMask("Ground", "Water");
        Physics.Raycast(transform.position, Vector3.forward, 50f, combinedMask);
    }
}

Anti-Patterns

1. Using GameObject.Find in Update

// BAD: Find is expensive -- runs every frame with string lookup
void Update()
{
    GameObject player = GameObject.Find("Player"); // Avoid!
}

// GOOD: Cache the reference
private GameObject player;
void Start()
{
    player = GameObject.FindWithTag("Player");
}

2. Non-Uniform Transform Scale

From the docs: "Don't adjust the Scale of your GameObject in the Transform component." Non-uniform scaling (e.g., 2, 4, 2) causes:

  • Colliders, Lights, Audio Sources to behave incorrectly
  • Rotated children to appear skewed
  • Performance degradation when instantiating scaled objects

Model assets at real-life scale instead.

3. Duplicating Data Across Prefabs Instead of Using ScriptableObjects

// BAD: Every prefab instance duplicates this data
public class EnemyStats : MonoBehaviour
{
    public int health = 100;
    public float speed = 5f;
    public string enemyName = "Goblin";
}

// GOOD: Use a ScriptableObject -- one asset, many references
[CreateAssetMenu(menuName = "ScriptableObjects/EnemyConfig")]
public class EnemyConfig : ScriptableObject
{
    public int health = 100;
    public float speed = 5f;
    public string enemyName = "Goblin";
}

public class Enemy : MonoBehaviour
{
    public EnemyConfig config; // All instances share the same asset
}

4. Forgetting EditorUtility.SetDirty for ScriptableObject Changes

// BAD: Changes in Edit mode won't persist
settings.value += 10;

// GOOD: Mark asset dirty so Unity saves it
settings.value += 10;
EditorUtility.SetDirty(settings);

5. String-Based Tag Comparison

// BAD: Allocates a new string for comparison (GC pressure)
if (gameObject.tag == "Player") { }

// GOOD: CompareTag avoids allocation
if (gameObject.CompareTag("Player")) { }

6. Ignoring Parent-Child Transform Relationships

Set a parent's location to (0,0,0) before adding children. Otherwise child local coordinates will not match global coordinates, causing confusion when positioning objects.


Key API Quick Reference

APIDescriptionNotes
GetComponent<T>()Get component on same GameObjectReturns null if not found
GetComponentInChildren<T>()Get component on self or childrenSearches depth-first
GetComponentsInChildren<T>()Get all matching components in hierarchyReturns array
AddComponent<T>()Attach new component at runtimeReturns the new component
Destroy(obj)Destroy a GameObject or ComponentDeferred to end of frame
Instantiate(prefab, pos, rot)Clone a prefab at position/rotationReturns the clone
GameObject.FindWithTag(tag)Find first active GO with tagReturns null if none
GameObject.FindGameObjectsWithTag(tag)Find all active GOs with tagReturns array
GameObject.Find(name)Find by name (expensive)Avoid in Update loops
gameObject.SetActive(bool)Activate/deactivateDisables all components
gameObject.CompareTag(tag)Tag comparison without GC allocPreferred over == tag
SceneManager.LoadScene(name)Load scene (replaces current)Must be in Build Settings
SceneManager.LoadSceneAsync(name, mode)Async scene loadingAdditive or Single mode
SceneManager.UnloadSceneAsync(name)Unload a loaded sceneReturns AsyncOperation
SceneManager.GetActiveScene()Get current active sceneReturns Scene struct
LayerMask.NameToLayer(name)Get layer index from nameReturns int
LayerMask.GetMask(names)Get combined mask from layer namesParams string array
Camera.mainGet MainCamera-tagged cameraCached by Unity

Related Skills

  • unity-scripting -- C# scripting patterns, MonoBehaviour lifecycle, coroutines, events
  • unity-physics -- Rigidbody, Colliders, physics layers, raycasting, triggers
  • unity-editor-tools -- Custom inspectors, editor windows, gizmos, build pipeline

Additional Resources

平台分布

Codex

35.93%
按下载量换算40

Claude

32.13%
按下载量换算36

Cursor

17.02%
按下载量换算19

Gemini CLI

9.58%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills