public void ResolveDependencies(ApplicationProxy application, SelectionProxy selection, UnityConnectProxy unityConnect, PackageFiltering packageFiltering, PackageManagerPrefs packageManagerPrefs, UpmClient upmClient, AssetStoreClient assetStoreClient, PackageDatabase packageDatabase, PackageManagerProjectSettingsProxy settingsProxy) { m_Application = application; m_Selection = selection; m_UnityConnect = unityConnect; m_PackageFiltering = packageFiltering; m_PackageManagerPrefs = packageManagerPrefs; m_UpmClient = upmClient; m_AssetStoreClient = assetStoreClient; m_PackageDatabase = packageDatabase; m_SettingsProxy = settingsProxy; foreach (var page in m_SerializedSimplePages) { page.ResolveDependencies(packageDatabase, packageFiltering); } foreach (var page in m_SerializedPaginatedPage) { page.ResolveDependencies(packageDatabase, assetStoreClient, packageFiltering, packageManagerPrefs); } }
public void ResolveDependencies(PackageDatabase packageDatabase, AssetStoreClient assetStoreClient, PackageFiltering packageFiltering, PackageManagerPrefs packageManagerPrefs) { ResolveDependencies(packageDatabase); m_AssetStoreClient = assetStoreClient; m_PackageFiltering = packageFiltering; m_PackageManagerPrefs = packageManagerPrefs; }
public void SetPackages(PackageFilter filter, IEnumerable <Package> packages) { if (filter == PackageFilter.Modules) { packages = packages.Where(pkg => pkg.IsBuiltIn); } else if (filter == PackageFilter.All) { packages = packages.Where(pkg => !pkg.IsBuiltIn && pkg.IsDiscoverable); } else if (filter == PackageFilter.InDevelopment) { packages = packages.Where(pkg => pkg.AnyInDevelopment); } else { packages = packages.Where(pkg => !pkg.IsBuiltIn); packages = packages.Where(pkg => pkg.Current != null && pkg.Current.IsDirectDependency); } OnLoaded(); ClearAll(); var packagesGroup = new PackageGroup(PackageGroupOrigins.Packages.ToString(), Selection); Groups.Add(packagesGroup); List.Add(packagesGroup); packagesGroup.previousGroup = null; var builtInGroup = new PackageGroup(PackageGroupOrigins.BuiltInPackages.ToString(), Selection); Groups.Add(builtInGroup); List.Add(builtInGroup); if (filter == PackageFilter.Modules) { packagesGroup.nextGroup = builtInGroup; builtInGroup.previousGroup = packagesGroup; builtInGroup.nextGroup = null; } else { packagesGroup.nextGroup = null; UIUtils.SetElementDisplay(builtInGroup, false); } var items = packages.OrderBy(pkg => pkg.VersionToDisplay == null ? pkg.Name : pkg.VersionToDisplay.DisplayName).ToList(); foreach (var package in items) { AddPackage(package); } if (!Selection.Selected.Any() && items.Any()) { Selection.SetSelection(items.First()); } PackageFiltering.FilterPackageList(this); }
private void ResolveDependencies() { var container = ServicesContainer.instance; m_ResourceLoader = container.Resolve <ResourceLoader>(); m_UnityConnect = container.Resolve <UnityConnectProxy>(); m_PackageFiltering = container.Resolve <PackageFiltering>(); m_PackageManagerPrefs = container.Resolve <PackageManagerPrefs>(); m_PackageDatabase = container.Resolve <PackageDatabase>(); m_PageManager = container.Resolve <PageManager>(); }
private void ResolveDependencies() { var container = ServicesContainer.instance; m_ResourceLoader = container.Resolve <ResourceLoader>(); m_Application = container.Resolve <ApplicationProxy>(); m_PackageFiltering = container.Resolve <PackageFiltering>(); m_PackageManagerPrefs = container.Resolve <PackageManagerPrefs>(); m_PageManager = container.Resolve <PageManager>(); m_UpmClient = container.Resolve <UpmClient>(); }
private void SetPackages(IEnumerable <Package> packages) { if (PackageCollection.Instance.Filter == PackageFilter.Modules) { packages = packages.Where(pkg => pkg.IsBuiltIn); } else if (PackageCollection.Instance.Filter == PackageFilter.Unity) { packages = packages.Where(pkg => !pkg.IsBuiltIn && pkg.IsUnityPackage && !(pkg.Current != null && (pkg.Current.IsLocal || pkg.Current.IsInDevelopment))); } else if (PackageCollection.Instance.Filter == PackageFilter.Other) { packages = packages.Where(pkg => !pkg.IsBuiltIn && !pkg.IsUnityPackage && !(pkg.Current != null && (pkg.Current.IsLocal || pkg.Current.IsInDevelopment))); } else // PackageCollection.Instance.Filter == PackageFilter.Local { packages = packages.Where(pkg => !pkg.IsBuiltIn && pkg.Current != null); } OnLoaded(); ClearAll(); var lastSelection = PackageCollection.Instance.SelectedPackage; Select(null); PackageItem defaultSelection = null; foreach (var package in packages) { var item = AddPackage(package); if (null == selectedItem && defaultSelection == null) { defaultSelection = item; } if (null == selectedItem && !string.IsNullOrEmpty(lastSelection) && package.Name.Equals(lastSelection)) { Select(item); } } if (selectedItem == null) { Select(defaultSelection); } PackageFiltering.FilterPackageList(this); }
private void ResolveDependencies(ResourceLoader resourceLoader, SelectionProxy selection, PackageFiltering packageFiltering, PackageManagerPrefs packageManagerPrefs, PackageDatabase packageDatabase, PageManager pageManager, PackageManagerProjectSettingsProxy settingsProxy) { m_ResourceLoader = resourceLoader; m_Selection = selection; m_PackageFiltering = packageFiltering; m_PackageManagerPrefs = packageManagerPrefs; m_PackageDatabase = packageDatabase; m_PageManager = pageManager; m_SettingsProxy = settingsProxy; }
public PackageManagerWindowRoot(ResourceLoader resourceLoader, SelectionProxy selection, PackageFiltering packageFiltering, PackageManagerPrefs packageManagerPrefs, PackageDatabase packageDatabase, PageManager pageManager, PackageManagerProjectSettingsProxy settingsProxy) { ResolveDependencies(resourceLoader, selection, packageFiltering, packageManagerPrefs, packageDatabase, pageManager, settingsProxy); styleSheets.Add(m_ResourceLoader.GetMainWindowStyleSheet()); var root = m_ResourceLoader.GetTemplate("PackageManagerWindow.uxml"); Add(root); cache = new VisualElementCache(root); }
public ServicesContainer() { // In the constructor we only need to worry about creating a brand new instance. // In the case of assembly reload, a deserialize step will automatically happen after the constructor // to restore all the serializable states/services and we don't need to worry about that m_HttpClientFactory = new HttpClientFactory(); m_UnityOAuthProxy = new UnityOAuthProxy(); m_SelectionProxy = new SelectionProxy(); m_AssetDatabaseProxy = new AssetDatabaseProxy(); m_UnityConnectProxy = new UnityConnectProxy(); m_ApplicationProxy = new ApplicationProxy(); m_IOProxy = new IOProxy(); m_SettingsProxy = new PackageManagerProjectSettingsProxy(); m_ResourceLoader = new ResourceLoader(); m_AssetStoreCache = new AssetStoreCache(); m_AssetStoreClient = new AssetStoreClient(); m_AssetStoreOAuth = new AssetStoreOAuth(); m_AssetStoreUtils = new AssetStoreUtils(); m_AssetStoreRestAPI = new AssetStoreRestAPI(); m_AssetStoreDownloadManager = new AssetStoreDownloadManager(); m_UpmCache = new UpmCache(); m_UpmClient = new UpmClient(); m_PackageFiltering = new PackageFiltering(); m_PackageManagerPrefs = new PackageManagerPrefs(); m_PackageDatabase = new PackageDatabase(); m_PageManager = new PageManager(); // Since dictionaries doesn't survive through serialization, we always re-create the default registration m_RegisteredObjects = new Dictionary <Type, object>(); RegisterDefaultServices(); m_DependenciesResolved = false; }
private void SetPackages(IEnumerable <Package> packages) { if (PackageCollection.Instance.Filter == PackageFilter.Modules) { packages = packages.Where(pkg => pkg.IsBuiltIn); } else if (PackageCollection.Instance.Filter == PackageFilter.All) { packages = packages.Where(pkg => !pkg.IsBuiltIn); } else { packages = packages.Where(pkg => !pkg.IsBuiltIn); packages = packages.Where(pkg => pkg.Current != null); } OnLoaded(); ClearAll(); var packagesGroup = new PackageGroup(PackageGroupOrigins.Packages.ToString()); Groups.Add(packagesGroup); List.Add(packagesGroup); packagesGroup.previousGroup = null; var builtInGroup = new PackageGroup(PackageGroupOrigins.BuiltInPackages.ToString()); Groups.Add(builtInGroup); List.Add(builtInGroup); if ((PackageCollection.Instance.Filter & PackageFilter.Modules) == PackageFilter.Modules) { packagesGroup.nextGroup = builtInGroup; builtInGroup.previousGroup = packagesGroup; builtInGroup.nextGroup = null; } else { packagesGroup.nextGroup = null; UIUtils.SetElementDisplay(builtInGroup, false); } var lastSelection = PackageCollection.Instance.SelectedPackage; Select(null); PackageItem defaultSelection = null; foreach (var package in packages.OrderBy(pkg => pkg.Versions.FirstOrDefault() == null ? pkg.Name : pkg.Versions.FirstOrDefault().DisplayName)) { var item = AddPackage(package); if (null == selectedItem && defaultSelection == null) { defaultSelection = item; } if (null == selectedItem && !string.IsNullOrEmpty(lastSelection) && package.Name.Equals(lastSelection)) { Select(item); } } if (selectedItem == null) { Select(defaultSelection); } PackageFiltering.FilterPackageList(this); }
public PaginatedPage(PackageDatabase packageDatabase, AssetStoreClient assetStoreClient, PackageFiltering packageFiltering, PackageManagerPrefs packageManagerPrefs, PackageFilterTab tab, PageCapability capability) : base(packageDatabase, tab, capability) { ResolveDependencies(packageDatabase, assetStoreClient, packageFiltering, packageManagerPrefs); }
public SimplePage(PackageDatabase packageDatabase, PackageFiltering packageFiltering, PackageFilterTab tab, PageCapability capability) : base(packageDatabase, tab, capability) { ResolveDependencies(packageDatabase, packageFiltering); }
public void ResolveDependencies(PackageDatabase packageDatabase, PackageFiltering packageFiltering) { ResolveDependencies(packageDatabase); m_PackageFiltering = packageFiltering; }
private void OnSearchChange(string searchText) { SearchFilter.SearchText = searchText; PackageList.SetSearchFilter(SearchFilter); PackageFiltering.FilterPackageList(PackageList); }
private void OnSearchChange(string searchText) { PackageSearchFilter.Instance.SearchText = searchText; PackageFiltering.FilterPackageList(PackageList); }