logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class LocalizationEphemeralGroupGuard

    Kills the per-locale Addressables groups and labels Unity Localization creates for a fixture's pseudo-locale codes as soon as they materialize. Unity Localization registers a collection's tables into Addressables from its asset postprocessor (ImportCollectionIntoProject), so the creation rides the asset import pipeline and lands whenever an import batch flushes — after the creating fixture's [TearDown] and even after the namespace-level LocalizationTestGroupLeakSentinel has already run. Synchronous teardown cleanup therefore sweeps before the groups exist and never sees them.

    Inheritance
    object
    LocalizationEphemeralGroupGuard
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Localization.Tests.Editor
    Assembly: Serenity.Localization.Tests.Editor.dll
    Syntax
    public static class LocalizationEphemeralGroupGuard
    Remarks

    The guard scans on every EditorApplication.update tick instead of reacting to AddressableAssetSettings.OnModificationGlobal or scheduling one-shot delayCalls: the Unity Test Framework holds back delayCall callbacks queued during an EditMode run, and modification events raised inside asset-import flushes proved unreliable to observe, so any trigger-plus-latch design can lose its one chance to sweep. A per-tick scan has no state to lose — whenever the editor ticks and an ephemeral group or label exists, it is removed. The scan is a name check over the group and label lists, which is cheap, and this class lives in the editor test assembly so it never ships.

    In this article
    © 2026 Serenity. All Rights Reserved