Esempio n. 1
0
        public static void CalculateTargetDependencies(Entities.Hash128 artifactHash, BuildTarget target, out ResolvedAssetID[] dependencies, AssetDatabaseExperimental.ImportSyncMode syncMode)
        {
            List <Entities.Hash128> assets = new List <Entities.Hash128>(LiveLinkBuildImporter.GetDependencies(artifactHash));
            List <ResolvedAssetID>  resolvedDependencies = new List <ResolvedAssetID>();

            HashSet <Entities.Hash128> visited = new HashSet <Entities.Hash128>();

            for (int i = 0; i < assets.Count; i++)
            {
                if (!visited.Add(assets[i]))
                {
                    continue;
                }

                var resolvedAsset = new ResolvedAssetID
                {
                    GUID       = assets[i],
                    TargetHash = CalculateTargetHash(assets[i], target, syncMode),
                };
                resolvedDependencies.Add(resolvedAsset);

                if (resolvedAsset.TargetHash.IsValid)
                {
                    assets.AddRange(LiveLinkBuildImporter.GetDependencies(resolvedAsset.TargetHash));
                }
            }

            dependencies = resolvedDependencies.ToArray();
        }
        public static void CalculateTargetDependencies(GUID guid, BuildTarget target, out ResolvedAssetID[] dependencies)
        {
            List <Entities.Hash128> assets = new List <Entities.Hash128>(LiveLinkBuildImporter.GetDependencies(guid.ToString(), target));
            List <ResolvedAssetID>  resolvedDependencies = new List <ResolvedAssetID>();

            HashSet <Entities.Hash128> visited = new HashSet <Entities.Hash128>();

            for (int i = 0; i < assets.Count; i++)
            {
                if (!visited.Add(assets[i]))
                {
                    continue;
                }

                resolvedDependencies.Add(new ResolvedAssetID
                {
                    GUID       = assets[i],
                    TargetHash = CalculateTargetHash(assets[i], target),
                });

                assets.AddRange(LiveLinkBuildImporter.GetDependencies(assets[i].ToString(), target));
            }

            dependencies = resolvedDependencies.ToArray();
        }
        public static void CalculateTargetDependencies(GUID guid, BuildTarget target, out ResolvedAssetID[] dependencies)
        {
#if LIVELINKS_ASSETPIPELINE
            var assets = LiveLinkBuildImporter.GetDependencies(guid.ToString(), target);
            dependencies = new ResolvedAssetID[assets.Length];
            for (int i = 0; i < assets.Length; i++)
            {
                dependencies[i].GUID       = assets[i];
                dependencies[i].TargetHash = CalculateTargetHash(assets[i], target);
            }
#else
            // This is only called after CalculateTargetHash, so we can just load the cached results and return those.
            // TODO: target is not taken into account, this will be included when sbp moves into the asset pipeline
            var cachedInfo = LoadTargetCachedInfo(guid, target);

            List <ResolvedAssetID> deps = new List <ResolvedAssetID>();
            foreach (var entry in cachedInfo.Dependencies)
            {
                deps.Add(new ResolvedAssetID
                {
                    GUID       = entry.Guid,
                    TargetHash = CalculateTargetHash(entry.Guid, target)
                });
            }
            dependencies = deps.ToArray();
#endif
        }
Esempio n. 4
0
        public static void CalculateTargetDependencies(GUID guid, BuildTarget target, out ResolvedAssetID[] dependencies)
        {
            var assets = LiveLinkBuildImporter.GetDependencies(guid.ToString(), target);

            dependencies = new ResolvedAssetID[assets.Length];
            for (int i = 0; i < assets.Length; i++)
            {
                dependencies[i].GUID       = assets[i];
                dependencies[i].TargetHash = CalculateTargetHash(assets[i], target);
            }
        }