public static void UnInstallPlugin() { #if AR_FOUNDATION_REMOTE_INSTALLED if (FixesForEditorSupport.Undo()) { Debug.LogError($"{displayName}: undoing AR Foundation fixes... Please press the 'Un-install Plugin' button again."); return; } #endif var listRequest = Client.List(true, false); runRequest(listRequest, () => { Assert.AreEqual(StatusCode.Success, listRequest.Status); var plugin = listRequest.Result.SingleOrDefault(_ => _.name == pluginId); Assert.IsNotNull(plugin); if (plugin.source == PackageSource.Embedded) { moveFolder(destinationFolderName, sourceFolderName); logUninstallSuccess(); } else { Debug.LogError("Removing plugin via Package Manager. This error should not be visible in production!"); var removeRequest = Client.Remove(pluginId); runRequest(removeRequest, () => { if (removeRequest.Status == StatusCode.Success) { logUninstallSuccess(); } else { Debug.LogError($"removeRequest failed {removeRequest.Error}"); } }); } }); void logUninstallSuccess() { Debug.Log($"{displayName} was uninstalled from Packages folder. To uninstall the plugin completely, please delete the ARFoundationRemoteInstaller folder."); } }
public static void UnInstallPlugin() { /*#if AR_FOUNDATION_REMOTE_INSTALLED * FixesForEditorSupport.Apply(); #endif * return;*/ #if AR_FOUNDATION_REMOTE_INSTALLED FixesForEditorSupport.Undo(); #endif var removalRequest = Client.Remove("com.kyrylokuzyk.arfoundationremote"); runRequest(removalRequest, () => { if (removalRequest.Status == StatusCode.Success) { Debug.Log(pluginName + " removed successfully" + ". If you want to delete the plugin completely, please delete the folder: Assets/Plugins/ARFoundationRemoteInstaller"); } else { Debug.LogError(pluginName + " removal failed: " + removalRequest.Error.message); } }); }