Esempio n. 1
0
        public Dictionary <string, string> GetDependencies(bool excludeDefaultPackages = true)
        {
            if (excludeDefaultPackages)
            {
                Dictionary <string, string> filteredDependencies = new Dictionary <string, string>();

                foreach (var kvp in dependencies)
                {
                    if (!ManifestLoader.IsHiddenDependency(kvp.Key))
                    {
                        filteredDependencies.Add(kvp.Key, kvp.Value);
                    }
                }
                return(filteredDependencies);
            }
            else
            {
                return(dependencies);
            }
        }
Esempio n. 2
0
        public static void ClearManifestDependencyList()
        {
            var manifest = ManifestLoader.LoadManifest();


            //  Don't remove package manager ui.
            Dictionary <string, string> newDeps = new Dictionary <string, string>();

            for (int i = 0; i < ManifestLoader.HIDDEN_DEPENDENCIES.Length; i++)
            {
                var key = ManifestLoader.HIDDEN_DEPENDENCIES[i];
                if (manifest.dependencies.ContainsKey(key))
                {
                    newDeps.Add(key, manifest.dependencies[key]);
                }
            }

            manifest.dependencies = newDeps;
            ManifestLoader.SaveManifest(manifest);
            AssetDatabase.Refresh();
        }
Esempio n. 3
0
        private void UpdateManifest()
        {
            var manifest = ManifestLoader.LoadManifest();

            if (m_chosenRegistry == 0)
            {
                string url = @"http://192.168.1.215:4873";
                manifest.scopedRegistries[0].url = url;
            }
            else if (m_chosenRegistry == 1)
            {
                manifest.scopedRegistries[0].url = @"http://localhost:4873";
            }

            var dependencies = manifest.GetDependencies(true);

            PackageData data = (PackageData)m_packageJsonData.targetObject;

            int numDependencies = dependencies.Count;

            data.dependencies = new PackageDependency[numDependencies];
            int i = 0;

            foreach (var dep in dependencies)
            {
                UnityEngine.Debug.Log("Updating with dependency: " + dep.Key);
                data.dependencies[i] = new PackageDependency()
                {
                    packageName    = dep.Key,
                    packageVersion = dep.Value
                };
                i++;
            }

            m_packageJsonData.ApplyModifiedProperties();

            ManifestLoader.SaveManifest(manifest);
            SavePackageJson(data.ToPackageJson());
            LoadPackage();
        }