Exemplo n.º 1
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_Selection     = container.Resolve <SelectionProxy>();
            m_AssetDatabase = container.Resolve <AssetDatabaseProxy>();
            m_IOProxy       = container.Resolve <IOProxy>();
        }
Exemplo n.º 2
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader      = container.Resolve <ResourceLoader>();
            m_SettingsProxy       = container.Resolve <PackageManagerProjectSettingsProxy>();
            m_PackageDatabase     = container.Resolve <PackageDatabase>();
            m_PackageManagerPrefs = container.Resolve <PackageManagerPrefs>();
            m_Selection           = container.Resolve <SelectionProxy>();
            m_AssetDatabase       = container.Resolve <AssetDatabaseProxy>();
            m_Application         = container.Resolve <ApplicationProxy>();
            m_IOProxy             = container.Resolve <IOProxy>();
            m_AssetStoreCache     = container.Resolve <AssetStoreCache>();
            m_PageManager         = container.Resolve <PageManager>();
            m_UpmCache            = container.Resolve <UpmCache>();
        }
        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 PackageDetailsSampleItem(IPackageVersion version, Sample sample, SelectionProxy selection, AssetDatabaseProxy assetDatabase, ApplicationProxy application, IOProxy iOProxy)
        {
            m_Selection        = selection;
            m_AssetDatabase    = assetDatabase;
            m_ApplicationProxy = application;
            m_IOProxy          = iOProxy;

            m_Version         = version;
            m_Sample          = sample;
            nameLabel.text    = sample.displayName;
            nameLabel.tooltip = sample.displayName; // add tooltip for when the label text is cut off
            sizeLabel.text    = sample.size;
            descriptionLabel.SetValueWithoutNotify(sample.description);
            descriptionLabel.multiline = true;
            RefreshImportStatus();
            importButton.clickable.clicked += OnImportButtonClicked;
        }
Exemplo n.º 5
0
        public PackageDetailsSamplesTab(ResourceLoader resourceLoader, PackageDatabase packageDatabase, SelectionProxy selection, AssetDatabaseProxy assetDatabase, ApplicationProxy application, IOProxy iOProxy)
        {
            m_Id              = k_Id;
            m_DisplayName     = L10n.Tr("Samples");
            m_ResourceLoader  = resourceLoader;
            m_PackageDatabase = packageDatabase;
            m_Selection       = selection;
            m_AssetDatabase   = assetDatabase;
            m_Application     = application;
            m_IOProxy         = iOProxy;

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

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

            RegisterCallback <GeometryChangedEvent>(OnGeometryChanged);
        }
        public PackageDependencySampleItemLowWidth(ResourceLoader resourceLoader, IPackageVersion version, Sample sample, SelectionProxy selection, AssetDatabaseProxy assetDatabase, ApplicationProxy application, IOProxy iOProxy)
        {
            var root = resourceLoader.GetTemplate("PackageDependencySampleItemLowWidth.uxml");

            Add(root);

            cache = new VisualElementCache(root);

            var sampleItem = new PackageDetailsSampleItem(version, sample, selection, assetDatabase, application, iOProxy);

            sampleItem.importButton.SetEnabled(version.isInstalled);

            var name        = sampleItem.nameLabel.text;
            var size        = sampleItem.sizeLabel.text;
            var description = sampleItem.descriptionLabel.text;

            itemName.text    = name;
            itemName.tooltip = name;

            sampleStatus.Add(sampleItem.importStatus);

            itemSizeOrVersion.value   = size;
            itemSizeOrVersion.tooltip = size;

            importButtonContainer.Add(sampleItem.importButton);

            if (!string.IsNullOrEmpty(description))
            {
                UIUtils.SetElementDisplay(sampleDescription, true);
                sampleDescription.SetValueWithoutNotify(description);
            }
            else
            {
                UIUtils.SetElementDisplay(sampleDescription, false);
            }
        }