public AssetStoreContext.PackageList GetPackageList() { Dictionary <string, AssetStoreContext.Package> dictionary = new Dictionary <string, AssetStoreContext.Package>(); foreach (PackageInfo package1 in PackageInfo.GetPackageList()) { AssetStoreContext.Package package2 = new AssetStoreContext.Package(); if (package1.jsonInfo == string.Empty) { package2.title = Path.GetFileNameWithoutExtension(package1.packagePath); package2.id = package1.packagePath; if (this.IsBuiltinStandardAsset(package1.packagePath)) { package2.publisher = new AssetStoreContext.LabelAndId() { label = "Unity Technologies", id = "1" }; package2.category = new AssetStoreContext.LabelAndId() { label = "Prefab Packages", id = "4" }; package2.version = "3.5.0.0"; } } else { JSONValue json = JSONParser.SimpleParse(package1.jsonInfo); if (!json.IsNull()) { package2.Initialize(json); if (package2.id == null) { JSONValue jsonValue = json.Get("link.id"); package2.id = jsonValue.IsNull() ? package1.packagePath : jsonValue.AsString(); } } else { continue; } } package2.local_icon = package1.iconURL; package2.local_path = package1.packagePath; if (!dictionary.ContainsKey(package2.id) || dictionary[package2.id].version_id == null || dictionary[package2.id].version_id == "-1" || package2.version_id != null && package2.version_id != "-1" && int.Parse(dictionary[package2.id].version_id) <= int.Parse(package2.version_id)) { dictionary[package2.id] = package2; } } AssetStoreContext.Package[] array = dictionary.Values.ToArray <AssetStoreContext.Package>(); return(new AssetStoreContext.PackageList() { results = array }); }
public AssetStoreContext.PackageList GetPackageList() { Dictionary <string, AssetStoreContext.Package> dictionary = new Dictionary <string, AssetStoreContext.Package>(); PackageInfo[] packageList = PackageInfo.GetPackageList(); PackageInfo[] array = packageList; int i = 0; while (i < array.Length) { PackageInfo packageInfo = array[i]; AssetStoreContext.Package package = new AssetStoreContext.Package(); if (packageInfo.jsonInfo == string.Empty) { package.title = Path.GetFileNameWithoutExtension(packageInfo.packagePath); package.id = packageInfo.packagePath; if (this.IsBuiltinStandardAsset(packageInfo.packagePath)) { package.publisher = new AssetStoreContext.LabelAndId { label = "Unity Technologies", id = "1" }; package.category = new AssetStoreContext.LabelAndId { label = "Prefab Packages", id = "4" }; package.version = "3.5.0.0"; } goto IL_144; } JSONValue json = JSONParser.SimpleParse(packageInfo.jsonInfo); if (!json.IsNull()) { package.Initialize(json); if (package.id != null) { goto IL_144; } JSONValue jSONValue = json.Get("link.id"); if (!jSONValue.IsNull()) { package.id = jSONValue.AsString(); goto IL_144; } package.id = packageInfo.packagePath; goto IL_144; } IL_203: i++; continue; IL_144: package.local_icon = packageInfo.iconURL; package.local_path = packageInfo.packagePath; if (!dictionary.ContainsKey(package.id) || dictionary[package.id].version_id == null || dictionary[package.id].version_id == "-1" || (package.version_id != null && package.version_id != "-1" && int.Parse(dictionary[package.id].version_id) <= int.Parse(package.version_id))) { dictionary[package.id] = package; goto IL_203; } goto IL_203; } AssetStoreContext.Package[] results = dictionary.Values.ToArray <AssetStoreContext.Package>(); return(new AssetStoreContext.PackageList { results = results }); }
public AssetStoreContext.PackageList GetPackageList() { Dictionary<string, AssetStoreContext.Package> dictionary = new Dictionary<string, AssetStoreContext.Package>(); PackageInfo[] packageList = PackageInfo.GetPackageList(); PackageInfo[] array = packageList; int i = 0; while (i < array.Length) { PackageInfo packageInfo = array[i]; AssetStoreContext.Package package = new AssetStoreContext.Package(); if (packageInfo.jsonInfo == string.Empty) { package.title = Path.GetFileNameWithoutExtension(packageInfo.packagePath); package.id = packageInfo.packagePath; if (this.IsBuiltinStandardAsset(packageInfo.packagePath)) { package.publisher = new AssetStoreContext.LabelAndId { label = "Unity Technologies", id = "1" }; package.category = new AssetStoreContext.LabelAndId { label = "Prefab Packages", id = "4" }; package.version = "3.5.0.0"; } goto IL_144; } JSONValue json = JSONParser.SimpleParse(packageInfo.jsonInfo); if (!json.IsNull()) { package.Initialize(json); if (package.id != null) { goto IL_144; } JSONValue jSONValue = json.Get("link.id"); if (!jSONValue.IsNull()) { package.id = jSONValue.AsString(); goto IL_144; } package.id = packageInfo.packagePath; goto IL_144; } IL_203: i++; continue; IL_144: package.local_icon = packageInfo.iconURL; package.local_path = packageInfo.packagePath; if (!dictionary.ContainsKey(package.id) || dictionary[package.id].version_id == null || dictionary[package.id].version_id == "-1" || (package.version_id != null && package.version_id != "-1" && int.Parse(dictionary[package.id].version_id) <= int.Parse(package.version_id))) { dictionary[package.id] = package; goto IL_203; } goto IL_203; } AssetStoreContext.Package[] results = dictionary.Values.ToArray<AssetStoreContext.Package>(); return new AssetStoreContext.PackageList { results = results }; }
public AssetStoreContext.PackageList GetPackageList() { Dictionary<string, AssetStoreContext.Package> dictionary = new Dictionary<string, AssetStoreContext.Package>(); foreach (PackageInfo package1 in PackageInfo.GetPackageList()) { AssetStoreContext.Package package2 = new AssetStoreContext.Package(); if (package1.jsonInfo == string.Empty) { package2.title = Path.GetFileNameWithoutExtension(package1.packagePath); package2.id = package1.packagePath; if (this.IsBuiltinStandardAsset(package1.packagePath)) { package2.publisher = new AssetStoreContext.LabelAndId() { label = "Unity Technologies", id = "1" }; package2.category = new AssetStoreContext.LabelAndId() { label = "Prefab Packages", id = "4" }; package2.version = "3.5.0.0"; } } else { JSONValue json = JSONParser.SimpleParse(package1.jsonInfo); if (!json.IsNull()) { package2.Initialize(json); if (package2.id == null) { JSONValue jsonValue = json.Get("link.id"); package2.id = jsonValue.IsNull() ? package1.packagePath : jsonValue.AsString(); } } else continue; } package2.local_icon = package1.iconURL; package2.local_path = package1.packagePath; if (!dictionary.ContainsKey(package2.id) || dictionary[package2.id].version_id == null || dictionary[package2.id].version_id == "-1" || package2.version_id != null && package2.version_id != "-1" && int.Parse(dictionary[package2.id].version_id) <= int.Parse(package2.version_id)) dictionary[package2.id] = package2; } AssetStoreContext.Package[] array = dictionary.Values.ToArray<AssetStoreContext.Package>(); return new AssetStoreContext.PackageList() { results = array }; }