{
  "id": "unity/scriptableobject-serialization-layout-change",
  "signature": "Serialization depth limit exceeded. Consider increasing the Serialization Depth Limit in Project Settings.",
  "signature_zh": "序列化深度限制已超出。考虑在项目设置中增加序列化深度限制。",
  "regex": "Serialization depth limit exceeded\\. Consider increasing the Serialization Depth Limit in Project Settings\\.",
  "domain": "unity",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A ScriptableObject or MonoBehaviour has a deeply nested reference chain (more than 7 levels) that exceeds Unity's default serialization depth.",
  "root_cause_type": "generic",
  "root_cause_zh": "ScriptableObject 或 MonoBehaviour 具有深度嵌套的引用链（超过 7 层），超出 Unity 的默认序列化深度。",
  "versions": [
    {
      "version": "Unity 2022.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2023.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2021.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Simply increasing the depth limit in Project Settings can mask the issue and lead to performance degradation from deep serialization.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding [SerializeReference] to fields does not reduce the depth; it only changes how references are stored.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Removing all nested objects breaks the data structure and loses functionality.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Restructure your data to avoid deep nesting: flatten references by using IDs or asset references instead of direct object references. Example: replace `public List<ChildData> children;` with `public List<string> childGuids;` and load via Resources.Load.",
      "success_rate": 0.85,
      "how": "Restructure your data to avoid deep nesting: flatten references by using IDs or asset references instead of direct object references. Example: replace `public List<ChildData> children;` with `public List<string> childGuids;` and load via Resources.Load.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase the serialization depth limit in Edit > Project Settings > Editor > Serialization Depth Limit to a higher value (e.g., 10 or 15).",
      "success_rate": 0.9,
      "how": "Increase the serialization depth limit in Edit > Project Settings > Editor > Serialization Depth Limit to a higher value (e.g., 10 or 15).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `[System.NonSerialized]` on intermediate fields that don't need to persist, breaking the serialization chain.",
      "success_rate": 0.75,
      "how": "Use `[System.NonSerialized]` on intermediate fields that don't need to persist, breaking the serialization chain.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Restructure your data to avoid deep nesting: flatten references by using IDs or asset references instead of direct object references. Example: replace `public List<ChildData> children;` with `public List<string> childGuids;` and load via Resources.Load.",
    "Increase the serialization depth limit in Edit > Project Settings > Editor > Serialization Depth Limit to a higher value (e.g., 10 or 15).",
    "Use `[System.NonSerialized]` on intermediate fields that don't need to persist, breaking the serialization chain."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.unity3d.com/Manual/script-Serialization.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-05-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}