コード例 #1
0
ファイル: PackageList.cs プロジェクト: sjb8100/uplift
        internal PackageRepo FindPackageAndRepository(DependencyDefinition packageDefinition)
        {
            PackageRepo blankResult = new PackageRepo();

            PackageRepo[] candidates = FindCandidatesForDefinition(packageDefinition);

            var strategies = new CandidateSelectionStrategy[] {
                new OnlyMatchingUnityVersionStrategy(Application.unityVersion),
                new FindBestPackageForUnityVersion(Application.unityVersion),
                new LatestSelectionStrategy()
            };

            candidates = SelectCandidates(candidates, strategies);

            if (candidates.Length > 0)
            {
                return(candidates[0]);
            }
            else
            {
                Debug.LogWarning("No package " + packageDefinition.Name + " matching requirements was found");
                return(blankResult);
            }
        }
コード例 #2
0
 public PackageRepo[] SelectCandidates(PackageRepo[] candidates, CandidateSelectionStrategy strategy)
 {
     return(strategy.Filter(candidates));
 }