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();
        }
        internal static void CalculateTargetDependencies(Entities.Hash128 artifactHash, BuildTarget target, out ResolvedAssetID[] dependencies, ImportMode syncMode)
        {
            List <Entities.Hash128> assets = new List <Entities.Hash128>(LiveLinkBuildImporter.GetDependenciesInternal(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.GetDependenciesInternal(resolvedAsset.TargetHash));
                }
            }

            dependencies = resolvedDependencies.ToArray();
        }
Пример #3
0
        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
        }
Пример #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);
            }
        }
Пример #5
0
        public static Hash128 CalculateTargetHash(GUID guid, BuildTarget target)
        {
#if LIVELINKS_ASSETPIPELINE
            return(LiveLinkBuildImporter.GetHash(guid.ToString(), target));
#else
            // Always calculate & return the new hash
            // TODO: target is not taken into account, this will be included when sbp moves into the asset pipeline
            var cache      = new BuildCache();
            var cachedInfo = CalculateTargetCachedInfo(cache.GetCacheEntry(guid, AssetBundleBuildVersion), target, null); // TODO: Script Property dependency

            // TODO: SBP returns recursive dependencies which is too much for Live Link, this will need to be changed when sbp moves into asset pipeline
            var targetHash = cachedInfo.Asset.Hash;
            foreach (var dependency in cachedInfo.Dependencies)
            {
                var dependencyHash = dependency.Hash;
                HashUtilities.ComputeHash128(ref dependencyHash, ref targetHash);
            }

            return(targetHash);
#endif
        }
 internal static Hash128 CalculateTargetHash(GUID guid, BuildTarget target, ImportMode importMode)
 {
     return(LiveLinkBuildImporter.GetHash(guid.ToString(), target, importMode));
 }
Пример #7
0
 public static Hash128 CalculateTargetHash(GUID guid, BuildTarget target)
 {
     return(LiveLinkBuildImporter.GetHash(guid.ToString(), target));
 }
Пример #8
0
 public static Hash128 CalculateTargetHash(GUID guid, BuildTarget target, AssetDatabaseExperimental.ImportSyncMode syncMode)
 {
     return(LiveLinkBuildImporter.GetHash(guid.ToString(), target, syncMode));
 }