{
  "id": "unity/assetdatabase-package-resource-not-found",
  "signature": "UnityEditor.AssetDatabase: Failed to load resource at path 'Packages/com.example.custompackage/Resources/MyAsset.asset'. Resource not found.",
  "signature_zh": "UnityEditor.AssetDatabase：无法在路径 'Packages/com.example.custompackage/Resources/MyAsset.asset' 加载资源。未找到资源。",
  "regex": "UnityEditor\\.AssetDatabase: Failed to load resource at path 'Packages/.*/Resources/.*'\\.",
  "domain": "unity",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The specified path inside a package does not exist, often because the resource was not placed in a 'Resources' folder within the package, or the package is not properly imported.",
  "root_cause_type": "generic",
  "root_cause_zh": "包内指定的路径不存在，通常是因为资源未放置在包内的“Resources”文件夹中，或者包未正确导入。",
  "versions": [
    {
      "version": "Unity 2022.3.8f1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2023.1.1f1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Moving the resource to a different folder within the package without using a 'Resources' folder will still fail because AssetDatabase.LoadResourceAtPath only searches 'Resources' folders.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Reimporting the package does not help if the resource path is incorrect or the folder structure is wrong.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the resource is inside a 'Resources' folder within the package. For example, create the folder structure: `Packages/com.example.custompackage/Resources/MyAsset.asset`. Then use `AssetDatabase.LoadAssetAtPath<ScriptableObject>(\"Packages/com.example.custompackage/Resources/MyAsset.asset\")`.",
      "success_rate": 0.9,
      "how": "Ensure the resource is inside a 'Resources' folder within the package. For example, create the folder structure: `Packages/com.example.custompackage/Resources/MyAsset.asset`. Then use `AssetDatabase.LoadAssetAtPath<ScriptableObject>(\"Packages/com.example.custompackage/Resources/MyAsset.asset\")`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the package is local, use `AssetDatabase.LoadAssetAtPath` with a relative path from the project root, e.g., `Assets/MyResources/MyAsset.asset`, instead of a package path.",
      "success_rate": 0.85,
      "how": "If the package is local, use `AssetDatabase.LoadAssetAtPath` with a relative path from the project root, e.g., `Assets/MyResources/MyAsset.asset`, instead of a package path.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Verify the package is properly installed and visible in the Project window under Packages. If not, reinstall the package via the Package Manager.",
      "success_rate": 0.75,
      "how": "Verify the package is properly installed and visible in the Project window under Packages. If not, reinstall the package via the Package Manager.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "确保资源位于包内的“Resources”文件夹中。例如，创建文件夹结构：`Packages/com.example.custompackage/Resources/MyAsset.asset`。然后使用 `AssetDatabase.LoadAssetAtPath<ScriptableObject>(\"Packages/com.example.custompackage/Resources/MyAsset.asset\")`。",
    "如果包是本地包，则使用相对项目根目录的路径，例如 `Assets/MyResources/MyAsset.asset`，而不是包路径。",
    "验证包是否已正确安装并在项目窗口的“包”下可见。如果不可见，请通过包管理器重新安装包。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.unity3d.com/Manual/LoadingResourcesAtRuntime.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-07-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}