public static bool OpenPackageInternal(string id)
{
Match match = AssetStoreContext.s_GeneratedIDRegExp.Match(id);
if (match.Success && File.Exists(match.Groups[1].Value))
{
AssetDatabase.ImportPackage(match.Groups[1].Value, true);
return(true);
}
foreach (PackageInfo package in PackageInfo.GetPackageList())
{
if (package.jsonInfo != string.Empty)
{
JSONValue jsonValue = JSONParser.SimpleParse(package.jsonInfo);
string str = !jsonValue.Get("id").IsNull() ? jsonValue["id"].AsString(true) : (string)null;
if (str != null && str == id && File.Exists(package.packagePath))
{
AssetDatabase.ImportPackage(package.packagePath, true);
return(true);
}
}
}
Debug.LogError((object)("Unknown package ID " + id));
return(false);
}