Skip to main content

Game Dev

Unity Serialization Assets

Multi-Language Standards

Preserve Unity serialized values, prefab overrides, and asset identity across field renames and reimports. Use for Unity serialization, prefab edits, Inspector fields, FormerlySerializedAs, or asset .meta pairing. (triggers: Unity serialization, Unity prefab, Unity asset meta, Unity scene serialization, FormerlySerializedAs)

  • New
  • v1.0.0
  • Reviewed Dec 4
  • No reviews yet

Getting started

Full instructions

Install the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.

Instructions: SKILL.mdv1.0.0

Unity Serialization and Assets

Priority: P1 (HIGH)

Preserve stored values and asset identity; a successful compile does not prove serialized data survived.

Fields and Serialization

  • Use [SerializeField] for private fields that the Inspector or prefab must store; public fields serialize by default.
  • Use [NonSerialized] for runtime-only state, caches, and references rebuilt at startup.
  • Serialize supported value types, UnityEngine.Object references, and serializable classes/structs. Do not expect dictionaries or plain interfaces to serialize without a custom representation.
  • Treat the serialized field name as data identity. Renaming it is a migration, not a cosmetic refactor.

Field Renames

  • Add [FormerlySerializedAs("oldName")] from UnityEngine.Serialization to the new field.
  • Keep the exact old name, including case. Add multiple attributes for multiple historical names.
  • Keep the script's class identity and .meta GUID stable.
  • Reimport the affected prefab or scene and assert the original non-default value and the script reference after reopening.
  • Remove historical attributes only after a controlled resave (AssetDatabase.ForceReserializeAssets) of every affected scene/prefab and a fresh reload check with the attribute removed; loading alone upgrades only in memory.

Prefab Overrides

  • Inspect instance overrides before editing a base prefab; an override can legitimately differ from the asset.
  • Use Prefab Mode or PrefabUtility APIs rather than hand-editing prefab YAML.
  • Record which properties are overridden, then reimport and reopen to verify the override and its target reference survive.
  • Do not delete and recreate a prefab to "fix" a reference; that changes the asset GUID and breaks external references.

Asset and .meta Pairing

  • The .meta GUID is the asset identity. Keep the asset and its .meta together when moving, copying, or version-controlling files.
  • Never delete a .meta file to force a refresh, and never hand-author a replacement GUID.
  • Move assets through the Editor or move both files together; reimport and verify references afterward.
  • For a fixture, let Unity generate the original .meta on first import, retain it byte-for-byte, and replace only the script source between arms.

Verification

  • Run an Edit Mode fixture on the pinned Editor.
  • Generate a prefab from the old field with a non-default value.
  • Branch migration and no-migration arms from copies of the same baseline; keep the script .meta stable.
  • Reimport, load the prefab, and assert the non-default value and the m_Script GUID.
  • The no-migration control must fail the value assertion, not build or import; a compile-only result is not evidence.

Anti-Patterns

  • No compile-only proof: A build passing does not prove a renamed field kept its value.
  • No YAML hand edits: Use the Editor or PrefabUtility; hand edits bypass import and reference handling.
  • No .meta regeneration: Regenerating a GUID breaks prefab, scene, and asset references.
  • No attribute-free rename: Renaming a serialized field without [FormerlySerializedAs] resets stored values to defaults.

References

  • Serialization migration and asset identity

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Signing

Verified copySLSA L1
Signed by
skills-hub.ai verified copy of https://github.com/HoangNguyen0403/agent-skills-standard
Method
Verified copy of the source repoPublished by a community repo, not by skills-hub.ai. We signed this exact version to vouch that its content matches what the repo published. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed

Reviews (0)

More from Multi-Language Standards

View source →
typescript-best-practicesWrite idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic.32 installscavemanUltra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says…26 installsphp-securityPHP-only security standards for database access, password handling, and input validation. Use when securing PHP apps against SQL injection, XSS, or weak password storage; defer Laravel middleware and security questions in other languages.16 installscommon-security-auditProbe for hardcoded secrets, injection surfaces, unguarded routes, business logic flaws, and platform-specific weaknesses across backend (Node, Go, Java, Python, Rust), frontend (React, Angular, Vue), and mobile (iOS, Android, Flutter)…14 installsandroid-performanceOptimize Android app startup, UI rendering, frame stability, and benchmark performance with Baseline Profiles, Macrobenchmark, and lazy initialization. Use when reducing startup time, diagnosing jank, or measuring rendering; defer Compose…10 installsandroid-composeBuild high-performance declarative UI with Jetpack Compose. Use when writing Composable functions, optimizing recomposition, hoisting state, or working with LazyColumn and side effects; defer deep-link and navigation routing to…9 installs

Frequently asked questions about unity-serialization-assets

What does the unity-serialization-assets skill do?

Preserve Unity serialized values, prefab overrides, and asset identity across field renames and reimports. Use for Unity serialization, prefab edits, Inspector fields, FormerlySerializedAs, or asset .meta pairing. (triggers: Unity serialization, Unity prefab, Unity asset meta, Unity scene serialization, FormerlySerializedAs) It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the unity-serialization-assets skill?

Run `npx @skills-hub-ai/cli install multi-language-standards-unity-serialization-assets` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/multi-language-standards-unity-serialization-assets/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does unity-serialization-assets work with?

unity-serialization-assets runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the unity-serialization-assets skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use unity-serialization-assets after installing it?

In Claude Code, type `/multi-language-standards-unity-serialization-assets` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the unity-serialization-assets skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/multi-language-standards-unity-serialization-assets)](https://skills-hub.ai/skills/multi-language-standards-unity-serialization-assets)
HTML
<a href="https://skills-hub.ai/skills/multi-language-standards-unity-serialization-assets"><img src="https://skills-hub.ai/api/badges/skill/multi-language-standards-unity-serialization-assets" alt="Install on Skills Hub"></a>

More options in the badge docs.