public static LocalInfo ParseLocalInfo(UnityEditor.PackageInfo localInfo) { if (string.IsNullOrEmpty(localInfo.jsonInfo)) { return(null); } var jsonInfo = Json.Deserialize(localInfo.jsonInfo) as Dictionary <string, object>; var id = jsonInfo?.GetString("id"); if (string.IsNullOrEmpty(id)) { return(null); } return(new LocalInfo { id = id, packagePath = localInfo.packagePath ?? string.Empty, versionString = jsonInfo.GetString("version") ?? string.Empty, versionId = jsonInfo.GetString("version_id") ?? string.Empty, publishedDate = jsonInfo.GetString("pubdate") ?? string.Empty, supportedVersion = jsonInfo.GetString("unity_version") ?? string.Empty, updateInfoFetched = false, canUpdate = false }); }
public static AssetStoreLocalInfo ParseLocalInfo(UnityEditor.PackageInfo localInfo) { if (string.IsNullOrEmpty(localInfo.jsonInfo)) { return(null); } try { var jsonInfo = Json.Deserialize(localInfo.jsonInfo) as Dictionary <string, object>; var id = jsonInfo?.GetString("id"); if (string.IsNullOrEmpty(id)) { return(null); } return(new AssetStoreLocalInfo { id = id, packagePath = localInfo.packagePath ?? string.Empty, versionString = jsonInfo.GetString("version") ?? string.Empty, versionId = jsonInfo.GetString("version_id") ?? string.Empty, uploadId = jsonInfo.GetString("upload_id") ?? string.Empty, publishedDate = jsonInfo.GetString("pubdate") ?? string.Empty, supportedVersion = jsonInfo.GetString("unity_version") ?? string.Empty, publishNotes = jsonInfo.GetString("publishnotes") ?? string.Empty, updateStatus = UpdateStatus.None }); } catch (Exception) { return(null); } }
public virtual UnityAssetStorePackageInfo[] GetLocalPackageList() { return(UnityAssetStorePackageInfo.GetPackageList()); }