public static Hash128 GetHash(string guid, BuildTarget target, AssetDatabaseExperimental.ImportSyncMode syncMode) { LiveLinkBuildPipeline.RemapBuildInAssetGuid(ref guid); AssetBundleTypeCache.RegisterMonoScripts(); // TODO: GetArtifactHash needs to take BuildTarget so we can get Artifacts for other than the ActiveBuildTarget return(AssetDatabaseExperimental.GetArtifactHash(guid, typeof(LiveLinkBuildImporter), syncMode)); }
public static Hash128 GetHash(string guid, BuildTarget target, AssetDatabaseExperimental.ImportSyncMode syncMode) { ImportMode importMode; switch (syncMode) { case AssetDatabaseExperimental.ImportSyncMode.Block: importMode = ImportMode.Synchronous; break; case AssetDatabaseExperimental.ImportSyncMode.Poll: importMode = ImportMode.NoImport; break; case AssetDatabaseExperimental.ImportSyncMode.Queue: importMode = ImportMode.Asynchronous; break; default: throw new ArgumentOutOfRangeException(nameof(syncMode), $"Invalid enum value encountered: {syncMode}"); } return(GetHash(guid, target, importMode)); }
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 Hash128 CalculateTargetHash(GUID guid, BuildTarget target, AssetDatabaseExperimental.ImportSyncMode syncMode) { return(LiveLinkBuildImporter.GetHash(guid.ToString(), target, syncMode)); }