logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SerenityRelocatedAssetImportGuard

    Protects a shipped settings asset the user relocated out of the package (see Serenity.Global.Infrastructure.Editor.SerenityPackageContentRelocator.MoveIntoFolder) from being silently overwritten in place on the next Serenity package import. Unity resolves an incoming .unitypackage entry by GUID, not by path — see Serenity.Editor.PackageBootstrapper.TombstonePlanner's remarks for the field-confirmed redirect-write behavior — so a relocated asset that still carries its shipped GUID gets the incoming content written straight into its new home. SerenityPackageImportScrubber cannot prevent this: its cleanup runs AFTER the import completes and only ever trashes leftovers under Serenity.Editor.ObsoleteAssetCleaner.SerenityFrameworkOwnership.OwnedRoots, never a path the user deliberately moved outside them.

    This guard backs up every relocated shipped asset's bytes BEFORE each package import — it does not matter yet whether this turns out to be a Serenity import at all, see Serenity.Editor.ObsoleteAssetCleaner.SerenityRelocatedAssetImportGuard.OnImportPackageStarted(System.String) — then restores whichever ones the import actually changed once it completes, but ONLY once the import is confirmed to be a Serenity one, see Serenity.Editor.ObsoleteAssetCleaner.SerenityRelocatedAssetImportGuard.OnImportPackageItemsCompleted(System.String[]). It mirrors SerenityPackageImportScrubber's four-hook wiring so both mechanisms read as one story: the scrubber removes what a previous version left behind, this guard restores what the current version tried to take back.

    Inheritance
    object
    SerenityRelocatedAssetImportGuard
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Editor.ObsoleteAssetCleaner
    Assembly: Serenity.ObsoleteAssetCleaner.Editor.dll
    Syntax
    public static class SerenityRelocatedAssetImportGuard
    In this article
    © 2026 Serenity. All Rights Reserved