{
  "id": "unity/input-system-action-map-conflict",
  "signature": "InvalidOperationException: Cannot enable action map 'Gameplay' because it is already enabled",
  "signature_zh": "无效操作异常：无法启用操作映射'Gameplay'，因为它已经启用",
  "regex": "InvalidOperationException: Cannot enable action map '.*' because it is already enabled",
  "domain": "unity",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Calling Enable() on an InputActionMap that is already enabled without first disabling it, causing a state conflict.",
  "root_cause_type": "generic",
  "root_cause_zh": "在未先禁用的情況下对已启用的InputActionMap调用Enable()，导致状态冲突。",
  "versions": [
    {
      "version": "1.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.4.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Calling Enable() multiple times in Update() without check",
      "why_fails": "Repeats the same error; no guard against double-enable.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disabling and re-enabling in same frame",
      "why_fails": "If not properly sequenced, still throws error; better to check enabled state.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check if action map is already enabled before enabling: if (!inputActionAsset.FindActionMap(\"Gameplay\").enabled) { inputActionAsset.FindActionMap(\"Gameplay\").Enable(); }",
      "success_rate": 0.95,
      "how": "Check if action map is already enabled before enabling: if (!inputActionAsset.FindActionMap(\"Gameplay\").enabled) { inputActionAsset.FindActionMap(\"Gameplay\").Enable(); }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a flag to track state: private bool gameplayEnabled; void EnableGameplay() { if (!gameplayEnabled) { inputActionAsset.FindActionMap(\"Gameplay\").Enable(); gameplayEnabled = true; } }",
      "success_rate": 0.9,
      "how": "Use a flag to track state: private bool gameplayEnabled; void EnableGameplay() { if (!gameplayEnabled) { inputActionAsset.FindActionMap(\"Gameplay\").Enable(); gameplayEnabled = true; } }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check if action map is already enabled before enabling: if (!inputActionAsset.FindActionMap(\"Gameplay\").enabled) { inputActionAsset.FindActionMap(\"Gameplay\").Enable(); }",
    "Use a flag to track state: private bool gameplayEnabled; void EnableGameplay() { if (!gameplayEnabled) { inputActionAsset.FindActionMap(\"Gameplay\").Enable(); gameplayEnabled = true; } }"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.unity3d.com/Packages/com.unity.inputsystem@1.6/manual/ActionMaps.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.93,
  "resolvable": "true",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}