├── img.png ├── FixPackageManagerSeeAllVersions ├── Editor │ ├── 0Harmony.dll │ ├── FixPackageManagerSeeAllVersions.cs.meta │ ├── FixPackageManagerSeeAllVersions.cs │ └── 0Harmony.dll.meta └── Editor.meta ├── LICENSE └── README.md /img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forestrf/FixPackageManagerSeeAllVersions/HEAD/img.png -------------------------------------------------------------------------------- /FixPackageManagerSeeAllVersions/Editor/0Harmony.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forestrf/FixPackageManagerSeeAllVersions/HEAD/FixPackageManagerSeeAllVersions/Editor/0Harmony.dll -------------------------------------------------------------------------------- /FixPackageManagerSeeAllVersions/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 416397dec092cd04dadcef7d4707e813 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /FixPackageManagerSeeAllVersions/Editor/FixPackageManagerSeeAllVersions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d137845e499fd774b91da8656d1ec159 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /FixPackageManagerSeeAllVersions/Editor/FixPackageManagerSeeAllVersions.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_2021_1_OR_NEWER 2 | using Harmony; 3 | using System.Reflection; 4 | using UnityEditor; 5 | using UnityEngine; 6 | 7 | public class FixPackageManagerSeeAllVersions { 8 | static HarmonyInstance harmony; 9 | 10 | [InitializeOnLoadMethod] 11 | static void Init() { 12 | Patch(); 13 | } 14 | 15 | static void Patch() { 16 | MethodInfo Method_IsDeveloperBuild = typeof(Unsupported).GetMethod("IsDeveloperBuild", BindingFlags.Static | BindingFlags.Public); 17 | 18 | if (Method_IsDeveloperBuild == null) { 19 | Debug.LogWarning("Can't find the method Unsupported.IsDeveloperBuild(). Patching won't be done."); 20 | return; 21 | } 22 | 23 | if (harmony == null) harmony = HarmonyInstance.Create("com.Nukefist.Ashkatchap.FixPackageManagerSeeAllVersions"); 24 | else harmony.UnpatchAll(); 25 | 26 | harmony.Patch(Method_IsDeveloperBuild, prefix: new HarmonyMethod(typeof(FixPackageManagerSeeAllVersions), "ReturnTrue")); 27 | } 28 | 29 | static bool ReturnTrue(ref bool __result) { 30 | __result = true; 31 | return false; 32 | } 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Andrés Leone Gámez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FixPackageManagerSeeAllVersions 2 | Allows viewing the button `See All Versions` in the Package Manager, which was hidden after Unity 2021 by design. 3 | 4 | This is needed because updating packages sometimes introduces new bugs, requiring to go back to a previous version. Without this button, such task must be done manually by editing the `Packages/manifest.json` file. 5 | 6 | # How to use 7 | Drag and drop the folder `FixPackageManagerSeeAllVersions` anywhere in the Assets folder of your Unity project. 8 | 9 | Open the package manager, click on the cog button next to the search toolbar, click `Advanced Project Settings` and toggle on `See All Versions` 10 | 11 | ![Image showing the feature](img.png) 12 | 13 | # How it works 14 | 15 | The button is only shown if the setting `See All Versions` is true. This setting is hidden and set to false if `Unsupported.IsDeveloperBuild()` returns false. 16 | Using Harmony that method is patched so that it returns always true instead of going inside Unity and ultimately return false. That means this solution can lead to side effects, but was the simplest one and I expect such side effects to not be problematic. Hopefully. 17 | 18 | Harmony patches the method after opening Unity or recompiling code and should takes less than a second. 19 | 20 | # Other 21 | 22 | It makes use of https://github.com/pardeike/Harmony to patch Unity. 23 | 24 | If you are already using Harmony for something else, make sure only one copy of the 0harmony.dll exists. Just remove all but one of them and that should be enough. 25 | -------------------------------------------------------------------------------- /FixPackageManagerSeeAllVersions/Editor/0Harmony.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b280c20cf861244b85ce35130d55ec7 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | '': Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 0 20 | Exclude Linux: 1 21 | Exclude Linux64: 1 22 | Exclude LinuxUniversal: 1 23 | Exclude OSXUniversal: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | - first: 27 | Any: 28 | second: 29 | enabled: 0 30 | settings: {} 31 | - first: 32 | Editor: Editor 33 | second: 34 | enabled: 1 35 | settings: 36 | CPU: AnyCPU 37 | DefaultValueInitialized: true 38 | OS: AnyOS 39 | - first: 40 | Facebook: Win 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: AnyCPU 45 | - first: 46 | Facebook: Win64 47 | second: 48 | enabled: 0 49 | settings: 50 | CPU: AnyCPU 51 | - first: 52 | Standalone: Linux 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: x86 57 | - first: 58 | Standalone: Linux64 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: x86_64 63 | - first: 64 | Standalone: LinuxUniversal 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: None 69 | - first: 70 | Standalone: OSXUniversal 71 | second: 72 | enabled: 0 73 | settings: 74 | CPU: AnyCPU 75 | - first: 76 | Standalone: Win 77 | second: 78 | enabled: 0 79 | settings: 80 | CPU: AnyCPU 81 | - first: 82 | Standalone: Win64 83 | second: 84 | enabled: 0 85 | settings: 86 | CPU: AnyCPU 87 | - first: 88 | Windows Store Apps: WindowsStoreApps 89 | second: 90 | enabled: 0 91 | settings: 92 | CPU: AnyCPU 93 | userData: 94 | assetBundleName: 95 | assetBundleVariant: 96 | --------------------------------------------------------------------------------