Пример #1
0
        /////////////////////////////////////////
        public void AddUnityPackages()
        {
            ManifestJsonUtils.Load();
            var mfdic = ManifestJsonUtils.GetDependencies();

            var path = "6fbeb6e9c013add41b6670a9d288955b".ToAssetPath();

            foreach (var s in fs.ReadAllText(path).Split('\n'))
            {
                if (s.IsEmpty())
                {
                    continue;
                }

                var ss   = s.Split('\t');
                var info = Utils.GetPackageInfo(ss[0]);

                m_root.AddChild(new PackageTreeItem {
                    name        = ss[0],
                    value       = ss[1],
                    displayName = ss[0],
                    id          = GetID(),
                    icon        = info.icon,
                    version     = mfdic.Contains(ss[1]) ? "インストール済" : ss[1],
                    installType = InstallType.データベースに直インストール,
                });
            }
            m_root.children = m_root.children.OrderBy(x => x).ToList();
        }
Пример #2
0
        /////////////////////////////////////////
        public void LoadDefault()
        {
            foreach (var p in P.i.m_data)
            {
                var info = Utils.GetPackageInfo(p.name);
                var it   = new PackageTreeItem {
                    name        = p.name,
                    value       = p.version,
                    displayName = p.displayName,
                    id          = GetID(),
                    icon        = info.icon,
                    version     = p.version.StartsWith("http") ? "URL" : p.version,
                };
                m_root.AddChild(it);
                //Debug.Log( it.displayName );
            }

            ManifestJsonUtils.Load();

            var mfdic = ManifestJsonUtils.GetDependencies();

            E.Load();
            foreach (var path in E.i.m_dirList)
            {
                if (path.IsEmpty())
                {
                    continue;
                }
                var files = DirectoryUtils.GetFiles(path, "package.json", System.IO.SearchOption.AllDirectories);
                foreach (var fname in files)
                {
                    //Debug.Log( sss );
                    var packageJson = PackageJson.Load(fname);

                    if (mfdic.Contains(packageJson.name))
                    {
                        continue;
                    }

                    var info = Utils.GetPackageInfo(packageJson.name);
                    var it   = new PackageTreeItem {
                        name        = packageJson.name,
                        value       = "file:" + fname.DirectoryName().Replace('\\', '/'),
                        displayName = info.displayName,
                        id          = GetID(),
                        icon        = info.icon,
                        version     = packageJson.version,
                        //localPackage = true,
                    };
                    m_root.AddChild(it);
                }
            }
        }