/// <summary> /// Initializes a new instance of the <see cref="TrackedAsset"/> class. /// </summary> /// <param name="tracker">The source tracker managing this object.</param> /// <param name="sessionAsset">The actual asset in the current session.</param> /// <param name="clonedAsset">A clone of the actual asset. If the actual asset is read-only, it is acceptable to use it instead of a clone.</param> public TrackedAsset(AssetSourceTracker tracker, Asset sessionAsset, Asset clonedAsset) { if (tracker == null) throw new ArgumentNullException(nameof(tracker)); if (sessionAsset == null) throw new ArgumentNullException(nameof(sessionAsset)); this.tracker = tracker; this.sessionAsset = sessionAsset; this.clonedAsset = clonedAsset; UpdateAssetImportPathsTracked(true); }
/// <summary> /// Initializes a new instance of the <see cref="AssetDependencyManager" /> class. /// </summary> /// <param name="session">The session.</param> /// <exception cref="System.ArgumentNullException">session</exception> internal AssetDependencyManager(PackageSession session) { if (session == null) { throw new ArgumentNullException(nameof(session)); } this.session = session; this.session.Packages.CollectionChanged += Packages_CollectionChanged; session.AssetDirtyChanged += Session_AssetDirtyChanged; AssetsWithMissingReferences = new Dictionary <Guid, AssetDependencies>(); MissingReferencesToParent = new Dictionary <Guid, HashSet <AssetDependencies> >(); Packages = new HashSet <Package>(); Dependencies = new Dictionary <Guid, AssetDependencies>(); SourceTracker = new AssetSourceTracker(session); // If the session has already a root package, then initialize the dependency manager directly if (session.LocalPackages.Any()) { Initialize(); } }