What problem does it solve?
This Skill audits JSON serialization for scenes, prefabs, and components to ensure correct data persistence, version compatibility, and proper handling of resource references. It helps prevent data corruption, save/load failures, and ensures that game assets can be reliably saved and loaded across different engine versions.
Core Features & Use Cases
- Runtime Data Exclusion: Verifies that runtime-only objects (e.g., physics bodies, loaded textures) are correctly marked with
[JsonIgnore] to prevent serialization errors and bloated files.
- Resource Path Serialization: Ensures that only asset paths (not the loaded resources themselves) are serialized, with proper error handling for missing assets.
- Custom Converter Implementation: Guides the creation and registration of
JsonConverter for complex types or backward compatibility.
- Circular Reference Handling: Checks for and helps resolve circular references in entity hierarchies to prevent infinite loops during serialization.
- Use Case: When a new
RigidBody2DComponent is added, this Skill ensures its RuntimeBody property is marked [JsonIgnore], and that its Material property serializes only a path to a material asset, not the entire loaded material object.
Quick Start
Review the RigidBody2DComponent for any runtime physics objects that are being serialized and suggest adding [JsonIgnore].