Token导航 LogoToken导航

Agent Skill · 待分类

unity-scripting(Unity scripting 命令行)

unity-scripting 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

unity-scripting 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 8,143。

总安装 318周安装 13GitHub Stars 14下载 103核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

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

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

Unity 脚本命令行工具,用于处理 GitHub 仓库协作事务。适合在 CI/CD 或团队协作中自动化处理 Issue 和 PR 流程。可在主流 AI 编辑器中调用以增强项目管理能力。

安装命令:npx skills add https://github.com/nice-wolf-studio/unity-claude-skills --skill unity-scripting 需确认是否要求登录凭证或访问私有仓库权限

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

上手步骤

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-scripting 怎么安装?

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

unity-scripting 支持哪些 AI 工具?

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

unity-scripting 需要什么权限?

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

unity-scripting 是免费的吗?

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

unity-scripting 用的人多吗?

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

unity-scripting 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

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

待分类类 Skill 对比

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

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
unity-scripting

Unity scripting 命令行 · 本页

31814只读未明确通过

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

SKILL.md 原文

Unity C# Scripting

Script Fundamentals

C# scripts (.cs files) are stored in the Assets folder. Scripts gain Unity functionality by inheriting from built-in types:

  • UnityEngine.Object -- Makes custom types assignable to Inspector fields
  • MonoBehaviour -- Attaches to GameObjects as components to control behavior in a scene
  • ScriptableObject -- Standalone data assets not attached to GameObjects

Scripts operate in two contexts:

  • Runtime scripts -- Execute in the Player build (use UnityEngine namespace)
  • Editor scripts -- Run only in the Editor (use UnityEditor namespace, place in Editor folders)

MonoBehaviour Lifecycle

MonoBehaviours always exist as a Component of a GameObject. The lifecycle event functions execute in a strict order. You cannot rely on the order in which the same event function is invoked for different GameObjects unless configured via Script Execution Order settings.

Execution Order (ASCII Diagram)

INITIALIZATION
  |
  v
[Awake] ---------> Called when script instance loads (once per lifetime)
  |
  v
[OnEnable] ------> Called when object/component becomes enabled
  |
  v
(SceneManager.sceneLoaded fires here -- after OnEnable, before Start)
  |
  v
[Start] ---------> Called before first frame Update (once per lifetime)
  |
  |
  |  +===========================================+
  |  |          PHYSICS LOOP (fixed timestep)    |
  |  |                                           |
  +->| [FixedUpdate] --> Internal Physics ------>|
  |  |       |                                   |
  |  | [yield WaitForFixedUpdate resumes]        |
  |  +===========================================+
  |
  v
[Update] --------> Called once per frame
  |
  v
[yield null / yield WaitForSeconds resumes]
  |
  v
(Internal Animation Update)
  |   [OnAnimatorMove]
  |   [OnAnimatorIK]
  |
  v
[LateUpdate] ----> Called after all Update functions complete
  |
  v
RENDERING
  | [OnWillRenderObject]
  | [OnPreCull] [OnBecameVisible/Invisible]
  | [OnPreRender]
  | [OnRenderObject]
  | [OnPostRender]
  | [OnRenderImage]
  |
  v
[OnGUI] ---------> Called for GUI rendering events
  |
  v
[yield WaitForEndOfFrame resumes]
  |
  v
DEACTIVATION / TEARDOWN
  |
  v
[OnDisable] -----> Called when component/object is disabled
  |
  v
[OnDestroy] -----> Called before object destruction

Key Lifecycle Callbacks

CallbackTimingUse For
Awake()Script instance loadsOne-time init, cache references
OnEnable()Component enabledSubscribe to events
Start()Before first UpdateInit that depends on other Awake() calls
FixedUpdate()Fixed timestep (default 0.02s)Physics calculations, Rigidbody forces
Update()Every frameInput, non-physics game logic
LateUpdate()After all Update callsCamera follow, post-Update adjustments
OnDisable()Component disabledUnsubscribe from events
OnDestroy()Before destructionFinal cleanup

Physics Callbacks

// 3D Physics
void OnCollisionEnter(Collision collision) { }
void OnCollisionStay(Collision collision) { }
void OnCollisionExit(Collision collision) { }
void OnTriggerEnter(Collider other) { }
void OnTriggerStay(Collider other) { }
void OnTriggerExit(Collider other) { }

// 2D Physics
void OnCollisionEnter2D(Collision2D collision) { }
void OnTriggerEnter2D(Collider2D other) { }

MonoBehaviour Properties (Unity 6)

PropertyPurpose
destroyCancellationTokenToken raised when MonoBehaviour is destroyed (for async cancellation)
didAwakeWhether Awake has been called
didStartWhether Start has been called
runInEditModeAllow script execution in editor
Full lifecycle reference: references/monobehaviour-lifecycle.md

Coroutines vs Async/Await

Unity supports two patterns for operations spanning multiple frames.

Coroutines (IEnumerator)

Methods that suspend with yield return and resume based on the yield instruction.

IEnumerator Fade()
{
    Color c = renderer.material.color;
    for (float alpha = 1f; alpha >= 0; alpha -= 0.1f)
    {
        c.a = alpha;
        renderer.material.color = c;
        yield return new WaitForSeconds(0.1f);
    }
}

void Update()
{
    if (Input.GetKeyDown("f"))
    {
        StartCoroutine(Fade());
    }
}

Yield Instructions:

  • yield return null -- Resume next frame (after Update)
  • yield return new WaitForSeconds(t) -- Resume after t seconds
  • yield return new WaitForFixedUpdate() -- Resume after FixedUpdate
  • yield return new WaitForEndOfFrame() -- Resume after rendering
  • yield return new WaitUntil(() => condition) -- Resume when condition is true
  • yield return StartCoroutine(other) -- Wait for nested coroutine

Important: Coroutines run on the main thread. Disabling the MonoBehaviour via enabled = false does NOT stop coroutines. Deactivating the GameObject or destroying the MonoBehaviour does stop them.

Awaitable (Unity 6 Async/Await)

Awaitable is Unity's custom async type -- usually more efficient than iterator-based coroutines. It is pooled to limit allocations.

async Awaitable SampleSchedulingJobsForNextFrame()
{
    await Awaitable.EndOfFrameAsync();
    var jobHandle = ScheduleSomethingWithJobSystem();
    await Awaitable.NextFrameAsync();
    jobHandle.Complete();
}

Awaitable Methods:

  • Awaitable.NextFrameAsync() -- Resume next frame
  • Awaitable.FixedUpdateAsync() -- Resume at next FixedUpdate
  • Awaitable.EndOfFrameAsync() -- Resume at end of frame
  • Awaitable.WaitForSecondsAsync(float) -- Resume after delay
  • Awaitable.MainThreadAsync() -- Force continuation on main thread
  • Awaitable.BackgroundThreadAsync() -- Force continuation on background thread

Critical constraint: Awaitable instances are pooled -- never await the same instance more than once. Multiple awaits cause undefined behavior.

FeatureCoroutineAwaitable
Return valuesNoYes (Awaitable<T>)
Thread switchingNoYes
Memory allocationPer-yield overheadPooled, minimal
CancellationManual StopCoroutineCancellationToken support
Error handlingNo try/catchFull try/catch/finally
Full async reference: references/coroutines-and-async.md

Events and Communication Patterns

C# Events and Delegates

public class Health : MonoBehaviour
{
    public event System.Action<float> OnDamageTaken;
    public event System.Action OnDeath;

    private float _hp = 100f;

    public void TakeDamage(float amount)
    {
        _hp -= amount;
        OnDamageTaken?.Invoke(amount);
        if (_hp <= 0f)
            OnDeath?.Invoke();
    }
}

public class UIHealthBar : MonoBehaviour
{
    [SerializeField] private Health _health;

    void OnEnable()
    {
        _health.OnDamageTaken += HandleDamage;
    }

    void OnDisable()
    {
        _health.OnDamageTaken -= HandleDamage;
    }

    private void HandleDamage(float amount)
    {
        // Update UI
    }
}

UnityEvents (Inspector-assignable)

using UnityEngine.Events;

public class GameManager : MonoBehaviour
{
    public UnityEvent OnGameStart;
    public UnityEvent<int> OnScoreChanged;

    public void StartGame()
    {
        OnGameStart?.Invoke();
    }
}

ScriptableObject Event Channels

[CreateAssetMenu(menuName = "Events/Void Event Channel")]
public class VoidEventChannel : ScriptableObject
{
    private System.Action _onEventRaised;

    public void RaiseEvent()
    {
        _onEventRaised?.Invoke();
    }

    public void Subscribe(System.Action listener) => _onEventRaised += listener;
    public void Unsubscribe(System.Action listener) => _onEventRaised -= listener;
}

ScriptableObjects

ScriptableObjects are serializable Unity types derived from UnityEngine.Object. They exist as independent project assets, not attached to GameObjects. Use them for shared data, configuration, and event channels.

[CreateAssetMenu(fileName = "Data", menuName = "ScriptableObjects/SpawnManagerScriptableObject", order = 1)]
public class SpawnManagerScriptableObject : ScriptableObject
{
    public string prefabName;
    public int numberOfPrefabsToCreate;
    public Vector3[] spawnPoints;
}

Key behaviors:

  • In Edit mode, Inspector modifications save automatically; script changes require EditorUtility.SetDirty()
  • At runtime, players can read ScriptableObject data but not persist modifications to disk
  • Memory efficient: multiple objects reference the same asset instance instead of duplicating data
Full ScriptableObject reference: references/scriptableobjects.md

Serialization Quick Reference

Unity serializes fields that meet ALL conditions:

  1. public OR has [SerializeField] attribute
  2. Not static, const, or readonly
  3. Is a serializable type

Serializable types: primitives, enums (32-bit or smaller), Unity built-in types (Vector2, Vector3, Rect, Color, AnimationCurve, etc.), [Serializable] custom classes/structs, UnityEngine.Object references, List<T> and arrays of any above type.

Key attributes:

[SerializeField] private float _speed = 5f;        // Serialize private field
[field: SerializeField] public float Speed { get; private set; } // Auto-property
[NonSerialized] public float tempValue;             // Exclude from serialization
[HideInInspector] public float hiddenValue;         // Serialize but hide from Inspector
[SerializeReference] private IMyInterface _impl;    // Polymorphic serialization

Not supported: Multidimensional arrays, jagged arrays, dictionaries, nested containers. Use ISerializationCallbackReceiver for custom serialization of unsupported types.

Core API Quick Reference

Vector3

// Static direction shortcuts
Vector3.zero;      // (0, 0, 0)
Vector3.one;       // (1, 1, 1)
Vector3.up;        // (0, 1, 0)
Vector3.forward;   // (0, 0, 1)
Vector3.right;     // (1, 0, 0)

// Common operations
float dist = Vector3.Distance(a, b);
float dot = Vector3.Dot(a.normalized, b.normalized);
Vector3 cross = Vector3.Cross(a, b);
Vector3 smoothed = Vector3.Lerp(from, to, t);
Vector3 moved = Vector3.MoveTowards(current, target, maxDelta);
Vector3 projected = Vector3.ProjectOnPlane(velocity, groundNormal);

Properties: magnitude, sqrMagnitude (use for comparisons -- avoids sqrt), normalized.

Quaternion

// Creation
Quaternion.identity;                             // No rotation
Quaternion.Euler(0f, 90f, 0f);                  // From Euler angles (degrees)
Quaternion.LookRotation(direction, Vector3.up);  // Face a direction
Quaternion.AngleAxis(45f, Vector3.up);           // Rotate around axis
Quaternion.FromToRotation(Vector3.up, normal);   // Rotation between directions

// Interpolation
Quaternion.Slerp(from, to, t);                  // Spherical interpolation
Quaternion.Lerp(from, to, t);                   // Linear interpolation

// Operations
float angle = Quaternion.Angle(a, b);           // Angle in degrees (0-180)
Vector3 rotatedPoint = rotation * point;         // Rotate a vector
Quaternion combined = rotA * rotB;               // Combine rotations

Never modify x, y, z, w directly. Use Euler(), AngleAxis(), or LookRotation().

Time

Time.deltaTime       // Seconds since last frame (use in Update)
Time.fixedDeltaTime  // Fixed timestep interval (use in FixedUpdate)
Time.time            // Time since game start
Time.timeScale       // 0 = paused, 1 = normal, 2 = double speed
Time.unscaledDeltaTime // Ignores timeScale (for UI animations during pause)

Debug

Debug.Log("Message");
Debug.LogWarning("Warning");
Debug.LogError("Error");
Debug.DrawRay(origin, direction, Color.red, duration);
Debug.DrawLine(start, end, Color.green, duration);

Common Patterns

Cached Component References

public class PlayerMovement : MonoBehaviour
{
    private Rigidbody _rb;
    private Transform _transform;

    void Awake()
    {
        _rb = GetComponent<Rigidbody>();
        _transform = transform; // Cache the transform property
    }

    void FixedUpdate()
    {
        // Use cached references -- never call GetComponent in Update/FixedUpdate
        _rb.AddForce(Vector3.up * 10f);
    }
}

Singleton Pattern

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

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

Async with Cancellation (Unity 6)

public class AsyncExample : MonoBehaviour
{
    async void Start()
    {
        try
        {
            await LoadAndProcessAsync(destroyCancellationToken);
        }
        catch (OperationCanceledException) { }
    }

    async Awaitable LoadAndProcessAsync(CancellationToken token)
    {
        await Awaitable.BackgroundThreadAsync();
        // Heavy computation here (off main thread)
        var result = ComputeExpensiveData();

        await Awaitable.MainThreadAsync();
        // Back on main thread -- safe to use Unity API
        ApplyResult(result);
    }
}

Conditional Wait (Awaitable replacement for WaitUntil)

public static async Awaitable AwaitableUntil(Func<bool> condition, CancellationToken token)
{
    while (!condition())
    {
        token.ThrowIfCancellationRequested();
        await Awaitable.NextFrameAsync();
    }
}

Anti-Patterns

Anti-PatternProblemFix
GetComponent<T>() in Update()Allocates and searches every frameCache in Awake()
GameObject.Find() in Update()Expensive string search every frameCache reference or use serialized field
Repeated new Vector3() in hot pathsUnnecessary constructor overhead each frameUse Vector3.zero, Vector3.one, or cache reusable values
Modifying Quaternion.x/y/z/w directlyProduces invalid rotationsUse Euler(), AngleAxis(), LookRotation()
Physics logic in Update()Inconsistent at variable frameratesUse FixedUpdate() for Rigidbody forces
Time.deltaTime in FixedUpdate()Works (Unity returns fixedDeltaTime implicitly) but is unclear to readersUse Time.fixedDeltaTime explicitly for clarity
Forgetting to unsubscribe events in OnDisableMemory leaks, null reference errorsAlways unsubscribe in OnDisable()
await-ing same Awaitable twiceUndefined behavior (pooled instances)Await once, or wrap with .AsTask()
Empty Update() / FixedUpdate() methodsUnity still calls them (overhead)Remove empty event functions
String-based Invoke("MethodName", t)No compile-time safety, breaks on renameUse coroutines or Awaitable instead

Related Skills

  • unity-foundations -- GameObjects, Components, Transforms, Scenes, Prefabs
  • unity-physics -- Rigidbody, Colliders, Raycasting, Physics materials
  • unity-input -- Input System, InputActions, PlayerInput component

Additional Resources

平台分布

Codex

36.77%
按下载量换算38

Claude

29.88%
按下载量换算31

Cursor

19.73%
按下载量换算20

Gemini CLI

9.6%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

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

安装前确认

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

继续浏览同类 Skills