/// <summary> /// On click 'Remove package' callback. /// </summary> public void RemoveClick() { Debug.LogFormat("[Bridge.UpdateClick]"); reloading = false; Debug.LogFormat("[RemoveClick]"); var selectedPackage = GetSelectedPackage(); if (selectedPackage.source == PackageSource.Git) { PackageUtils.UninstallPackage(selectedPackage.name); } else { Expose.FromObject(packageDetails).Call("RemoveClick"); } }
/// <summary> /// On click 'Update package' callback. /// </summary> public void UpdateClick() { Debug.LogFormat("[Bridge.UpdateClick]"); reloading = false; var selectedPackage = GetSelectedPackage(); if (selectedPackage.source == PackageSource.Git) { string packageId = selectedPackage.packageId; string url = PackageUtils.GetRepoUrl(packageId); #if UNITY_2019_3_OR_NEWER string refName = GetSelectedVersion().packageInfo.git.revision; #else string refName = GetSelectedVersion().VersionId.Split('@')[1]; #endif PackageUtils.UninstallPackage(selectedPackage.name); PackageUtils.InstallPackage(selectedPackage.name, url, refName); } else { Expose.FromObject(packageDetails).Call("UpdateClick"); } }