public static void CheckInstallation() { //Default CurrentPipeline = Pipeline.BuiltIn; //Packages installed, but not active (though this will cause major conflicts!) if (GraphicsSettings.renderPipelineAsset == null) { return; } if (PackageManager.packages == null) { PackageManager.RetreivePackageList(); } foreach (UnityEditor.PackageManager.PackageInfo p in PackageManager.packages) { if (p.name == LWRP_PACKAGE_ID) { CurrentPipeline = Pipeline.LWRP; minVersion = new System.Version(MIN_LWRP_VERSION); maxVersion = new System.Version(MAX_LWRP_VERSION); CheckVersion(p); return; } if (p.name == URP_PACKAGE_ID) { CurrentPipeline = Pipeline.URP; minVersion = new System.Version(MIN_URP_VERSION); maxVersion = new System.Version(MAX_URP_VERSION); CheckVersion(p); return; } if (p.name == HDRP_PACKAGE_ID) { CurrentPipeline = Pipeline.HDRP; minVersion = new System.Version(MIN_HDRP_VERSION); maxVersion = new System.Version(MAX_HDRP_VERSION); CheckVersion(p); return; } } }
public static void Initialize() { IS_INSTALLED = false; Log.Clear(); PackageVersionCheck.CheckForUpdate(); UnityVersionCheck.CheckCompatibility(); PackageManager.RetreivePackageList(); RenderPipelineInstallation.CheckInstallation(); //Check first, in case URP is installed PostProcessingInstallation.CheckPackageInstallation(); Demo.FindPackages(); }
public static void Initialize() { IS_INSTALLED = false; Log.Clear(); PackageVersionCheck.CheckForUpdate(); UnityVersionCheck.CheckCompatibility(); #if PACKAGE_MANAGER PackageManager.RetreivePackageList(); #endif PostProcessingInstallation.CheckPPSInstallation(); #if UNITY_2018_1_OR_NEWER RenderPipelineInstallation.CheckInstallation(); #endif //PPS Installation is checked before the folder is, so the installation type has been determined // CheckRootFolder(); Demo.FindPackages(); }
public static Configuration CheckPackageInstallation() { IS_INSTALLED = false; Config = Configuration.Auto; if (PackageManager.packages == null) { PackageManager.RetreivePackageList(); } foreach (UnityEditor.PackageManager.PackageInfo p in PackageManager.packages) { if (p.name == PACKAGE_ID) { PPS_VERSION = p.version.Replace("-preview", string.Empty); LATEST_COMPATIBLE_VERSION = p.versions.latestCompatible; //Validate installed version against compatible range System.Version curVersion = new System.Version(PPS_VERSION); System.Version minVersion = new System.Version(MIN_PPS_VERSION); System.Version maxVersion = new System.Version(MAX_PPS_VERSION); System.Version latestVersion = new System.Version(LATEST_COMPATIBLE_VERSION); //Clamp to maximum compatible version if (latestVersion > maxVersion) { latestVersion = maxVersion; } if (curVersion >= minVersion && curVersion <= maxVersion) { PPSVersionStatus = VersionStatus.Compatible; } if (curVersion < minVersion || curVersion < latestVersion) { PPSVersionStatus = VersionStatus.Outdated; } if (curVersion < minVersion || curVersion > maxVersion) { PPSVersionStatus = VersionStatus.InCompatible; } #if SCPE_DEV Debug.Log("<b>CheckPPSInstallation</b> PPS version " + p.version + " Installed. Required: " + MIN_PPS_VERSION); #endif IS_INSTALLED = true; Config = Configuration.PackageManager; } } //PPS not installed if (IS_INSTALLED == false) { #if UNITY_2019_3_OR_NEWER //URP is available and has integrated PP if (RenderPipelineInstallation.CurrentPipeline == RenderPipelineInstallation.Pipeline.URP && RenderPipelineInstallation.VersionStatus == RenderPipelineInstallation.Version.Compatible) { IS_INSTALLED = true; Config = Configuration.Integrated; PPSVersionStatus = VersionStatus.Compatible; #if SCPE_DEV Debug.Log("<b>CheckPPSInstallation</b> URP installed, integrated PP available"); #endif } #else //On older versions, fetch latest compatible PSS package UnityEditor.PackageManager.Requests.SearchRequest r = Client.Search(PACKAGE_ID); while (r.Status == StatusCode.InProgress) { //Waiting } if (r.IsCompleted) { LATEST_COMPATIBLE_VERSION = r.Result[0].versions.latestCompatible; //Clamp to maximum compatible version System.Version maxVersion = new System.Version(MAX_PPS_VERSION); System.Version latestVersion = new System.Version(LATEST_COMPATIBLE_VERSION); if (latestVersion > maxVersion) { LATEST_COMPATIBLE_VERSION = MAX_PPS_VERSION; } } #endif } #if SCPE_DEV if (IS_INSTALLED) { Debug.Log("<b>PostProcessingInstallation</b> " + Config + " version is installed"); } else { Debug.Log("<b>PostProcessingInstallation</b> Post Processing Stack is not installed"); } #endif return(Config); }