Ejemplo n.º 1
0
        public void ResolveDependencies(ApplicationProxy application,
                                        SelectionProxy selection,
                                        UnityConnectProxy unityConnect,
                                        PackageFiltering packageFiltering,
                                        PackageManagerPrefs packageManagerPrefs,
                                        UpmClient upmClient,
                                        UpmRegistryClient upmRegistryClient,
                                        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_UpmRegistryClient   = upmRegistryClient;
            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);
            }
        }
Ejemplo n.º 2
0
        public static void HandleInvalidOrUnreachableOnlineUrl(string onlineUrl, string offlineDocPath, string docType, string analyticsEvent, IPackageVersion version, IPackage package, ApplicationProxy applicationProxy)
        {
            if (!string.IsNullOrEmpty(offlineDocPath))
            {
                applicationProxy.RevealInFinder(offlineDocPath);

                PackageManagerWindowAnalytics.SendEvent($"{analyticsEvent}OnDisk", version?.uniqueId);
                return;
            }

            if (!string.IsNullOrEmpty(onlineUrl))
            {
                // With the current `UpmPackageDocs.GetDocumentationUrl` implementation,
                // We'll get invalid url links for non-unity packages on unity3d.com
                // We want to avoiding opening these kinds of links to avoid confusion.
                if (!UpmClient.IsUnityUrl(onlineUrl) || package.Is(PackageType.Unity) || version.packageUniqueId.StartsWith("com.unity."))
                {
                    applicationProxy.OpenURL(onlineUrl);

                    PackageManagerWindowAnalytics.SendEvent($"{analyticsEvent}UnreachableOrInvalidUrl", version?.uniqueId);
                    return;
                }
            }

            PackageManagerWindowAnalytics.SendEvent($"{analyticsEvent}NotFound", version?.uniqueId);

            Debug.LogError(string.Format(L10n.Tr("[Package Manager Window] Unable to find valid {0} for this {1}."), docType, package.GetDescriptor()));
        }
Ejemplo n.º 3
0
 private void ResolveDependencies(ResourceLoader resourceLoader,
                                  ExtensionManager extensionManager,
                                  SelectionProxy selection,
                                  PackageFiltering packageFiltering,
                                  PackageManagerPrefs packageManagerPrefs,
                                  PackageDatabase packageDatabase,
                                  PageManager pageManager,
                                  PackageManagerProjectSettingsProxy settingsProxy,
                                  UnityConnectProxy unityConnectProxy,
                                  ApplicationProxy applicationProxy,
                                  UpmClient upmClient,
                                  AssetStoreCachePathProxy assetStoreCachePathProxy)
 {
     m_ResourceLoader           = resourceLoader;
     m_ExtensionManager         = extensionManager;
     m_Selection                = selection;
     m_PackageFiltering         = packageFiltering;
     m_PackageManagerPrefs      = packageManagerPrefs;
     m_PackageDatabase          = packageDatabase;
     m_PageManager              = pageManager;
     m_SettingsProxy            = settingsProxy;
     m_UnityConnectProxy        = unityConnectProxy;
     m_ApplicationProxy         = applicationProxy;
     m_UpmClient                = upmClient;
     m_AssetStoreCachePathProxy = assetStoreCachePathProxy;
 }
 private void ResolveDependencies(ResourceLoader resourceLoader, PackageFiltering packageFiltering, UpmClient upmClient, PackageDatabase packageDatabase, PageManager packageManager)
 {
     m_ResourceLoader   = resourceLoader;
     m_PackageFiltering = packageFiltering;
     m_UpmClient        = upmClient;
     m_PackageDatabase  = packageDatabase;
     m_PageManager      = packageManager;
 }
Ejemplo n.º 5
0
        public InProgressDropdown(ResourceLoader resourceLoader,
                                  PackageFiltering packageFiltering,
                                  UpmClient upmClient,
                                  AssetStoreDownloadManager assetStoreDownloadManager,
                                  PackageDatabase packageDatabase,
                                  PageManager packageManager)
        {
            ResolveDependencies(resourceLoader, packageFiltering, upmClient, assetStoreDownloadManager, packageDatabase, packageManager);
            styleSheets.Add(m_ResourceLoader.inProgressDropdownStyleSheet);

            m_Height = 0;
            Refresh();
        }
Ejemplo n.º 6
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader            = container.Resolve <ResourceLoader>();
            m_Application               = container.Resolve <ApplicationProxy>();
            m_UnityConnect              = container.Resolve <UnityConnectProxy>();
            m_PackageFiltering          = container.Resolve <PackageFiltering>();
            m_PackageDatabase           = container.Resolve <PackageDatabase>();
            m_PageManager               = container.Resolve <PageManager>();
            m_UpmClient                 = container.Resolve <UpmClient>();
            m_AssetStoreDownloadManager = container.Resolve <AssetStoreDownloadManager>();
            m_SettingsProxy             = container.Resolve <PackageManagerProjectSettingsProxy>();
            m_IOProxy = container.Resolve <IOProxy>();
        }
Ejemplo n.º 7
0
 public PackageManagerWindowRoot(ResourceLoader resourceLoader,
                                 ExtensionManager extensionManager,
                                 SelectionProxy selection,
                                 PackageFiltering packageFiltering,
                                 PackageManagerPrefs packageManagerPrefs,
                                 PackageDatabase packageDatabase,
                                 PageManager pageManager,
                                 PackageManagerProjectSettingsProxy settingsProxy,
                                 UnityConnectProxy unityConnectProxy,
                                 ApplicationProxy applicationProxy,
                                 UpmClient upmClient,
                                 AssetStoreCachePathProxy assetStoreCachePathProxy)
 {
     ResolveDependencies(resourceLoader, extensionManager, selection, packageFiltering, packageManagerPrefs, packageDatabase, pageManager, settingsProxy, unityConnectProxy, applicationProxy, upmClient, assetStoreCachePathProxy);
 }
Ejemplo n.º 8
0
        public void ResolveDependencies(UnityConnectProxy unityConnect,
                                        AssetStoreCache assetStoreCache,
                                        AssetStoreUtils assetStoreUtils,
                                        AssetStoreRestAPI assetStoreRestAPI,
                                        UpmClient upmClient,
                                        IOProxy ioProxy)
        {
            m_UnityConnect      = unityConnect;
            m_AssetStoreCache   = assetStoreCache;
            m_AssetStoreUtils   = assetStoreUtils;
            m_AssetStoreRestAPI = assetStoreRestAPI;
            m_UpmClient         = upmClient;
            m_IOProxy           = ioProxy;

            m_ListOperation?.ResolveDependencies(unityConnect, assetStoreRestAPI, assetStoreCache);
        }
        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_EditorAnalyticsProxy = new EditorAnalyticsProxy();
            m_IOProxy       = new IOProxy();
            m_SettingsProxy = new PackageManagerProjectSettingsProxy();
            m_ClientProxy   = new ClientProxy();

            m_ResourceLoader   = new ResourceLoader();
            m_ExtensionManager = new ExtensionManager();

            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_AssetStoreCallQueue       = new AssetStoreCallQueue();
            m_AssetStoreCachePathProxy  = new AssetStoreCachePathProxy();

            m_UpmCache           = new UpmCache();
            m_UpmClient          = new UpmClient();
            m_UpmRegistryClient  = new UpmRegistryClient();
            m_UpmCacheRootClient = new UpmCacheRootClient();

            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;
            m_InitializeState      = State.NotInitialized;
        }
        public AddPackageByNameDropdown(ResourceLoader resourceLoader, PackageFiltering packageFiltering, UpmClient upmClient, PackageDatabase packageDatabase, PageManager packageManager, EditorWindow anchorWindow)
        {
            ResolveDependencies(resourceLoader, packageFiltering, upmClient, packageDatabase, packageManager);

            styleSheets.Add(m_ResourceLoader.inputDropdownStyleSheet);

            var root = m_ResourceLoader.GetTemplate("AddPackageByNameDropdown.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            Init(anchorWindow);
        }
Ejemplo n.º 11
0
 public static void ManagePackageManagerEntitlementError(UpmClient upmClient)
 {
     upmClient.onListOperation += OnListOperation;
     upmClient.List(true);
 }