unity-prefab

Automate Unity prefab creation, instantiation, applying, and unpacking operations.

1|Updated Feb 22, 2024
One-click install
npx skills add https://github.com/Stardust-liu/EDC_Framework --skill unity-prefab-stardust-liu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-prefab
Source: https://github.com/Stardust-liu/EDC_Framework/tree/main/Assets/AI/Unity-Skills-1.5.5/unity-skills/skills/prefab
Command: npx skills add https://github.com/Stardust-liu/EDC_Framework --skill unity-prefab-stardust-liu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prefab management in Unity often involves repetitive steps: creating prefabs from scene objects, instantiating them at various positions, applying runtime changes back to sources, and unpacking instances. This skill centralizes and automates these tasks to improve consistency and speed.

Core Features & Use Cases

  • prefab_create: Create a prefab from a scene GameObject.
  • prefab_instantiate: Instantiate a prefab into the scene.
  • prefab_instantiate_batch: Instantiate multiple prefabs in a single call.
  • prefab_apply: Apply instance changes back to the source prefab.
  • prefab_unpack: Unpack a prefab instance, breaking its link to the source.
  • prefab_get_overrides: Retrieve overrides on a prefab instance.
  • prefab_revert_overrides: Revert overrides to prefab defaults.
  • prefab_apply_overrides: Apply overrides from an instance to the source prefab.

Quick Start

Instantiate several prefabs from Enemy.prefab at different positions using prefab_instantiate_batch.

Frequently Asked Questions about unity-prefab

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I batch instantiate multiple Unity prefabs at different positions?

You can automate applying instance overrides back to the source prefab using the prefab_apply_overrides and prefab_apply operations. These functions take overridden values from a scene instance and save them directly to the source prefab asset, ensuring consistency across all instances.

How do I create a prefab from an existing GameObject in a Unity scene?

To unpack a prefab instance and break its link to the source, use the prefab_unpack operation. This function disconnects the scene instance from the original prefab asset, allowing independent modifications without affecting the source object.

What is the best way to revert overrides on a Unity prefab instance?

You can retrieve overrides on a Unity prefab instance using the prefab_get_overrides operation. This function inspects the specified instance and returns a list of all properties that differ from the source prefab, helping track scene modifications before applying or reverting them.

Can I instantiate a prefab into a specific parent GameObject in Unity?

Yes, you can instantiate a prefab into a specific parent GameObject in Unity using the prefab_instantiate operation. By providing the parentName parameter along with prefabPath and position coordinates, the function nests the new instance under the target parent.