logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class PrefetchPolicyProfileRowsEditor

    The profile-row facet of CreatePrefetchPolicyWindow — row list lifecycle, drawing, and row-binding validation — as its own named collaborator carrying its own serialized state, the same composition Serenity.Global.Infrastructure.Editor.SerenityWizardTargetAsset already uses. Embedded via a single [SerializeField] field on the window instead of the window owning the row list, its serialized mirror, and every row-drawing/validating method directly.

    Inheritance
    object
    PrefetchPolicyProfileRowsEditor
    Implements
    ISerenityWizardDraftHolder
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.AssetPrefetcher.Infrastructure.Editor.Builder
    Assembly: Serenity.UnityAssetPrefetcher.Infrastructure.Editor.dll
    Syntax
    public sealed class PrefetchPolicyProfileRowsEditor : ISerenityWizardDraftHolder

    Constructors

    PrefetchPolicyProfileRowsEditor()

    Declaration
    public PrefetchPolicyProfileRowsEditor()

    Properties

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    DeletedSourceNotice

    Declaration
    public SerenityWizardInlineNotice DeletedSourceNotice { get; }
    Property Value
    Type Description
    SerenityWizardInlineNotice

    Drafts

    Declaration
    public IReadOnlyList<SerenityWizardScratchDraft<PrefetchPolicyProfile>> Drafts { get; }
    Property Value
    Type Description
    IReadOnlyList<SerenityWizardScratchDraft<PrefetchPolicyProfile>>

    this[int]

    Declaration
    public SerenityWizardScratchDraft<PrefetchPolicyProfile> this[int index] { get; }
    Parameters
    Type Name Description
    int index
    Property Value
    Type Description
    SerenityWizardScratchDraft<PrefetchPolicyProfile>

    LiveDraftInstances

    Every row's live scratch instance — see Serenity.Global.Infrastructure.Editor.SerenityWizardDraftListLifecycle`1.LiveDraftInstances.

    Declaration
    public IReadOnlyList<ScriptableObject> LiveDraftInstances { get; }
    Property Value
    Type Description
    IReadOnlyList<ScriptableObject>

    Methods

    AddRow(string)

    Appends a brand-new (unbound) row exactly like the "+ Add Profile" button.

    Declaration
    public void AddRow(string id)
    Parameters
    Type Name Description
    string id

    ApplyPresetToDefaultRow(int, int, PrefetchStrategy, PrefetchEvictionPolicy)

    Applies a preset to the 'default' row, inserting a fresh unbound one first if none exists.

    Declaration
    public void ApplyPresetToDefaultRow(int maxItems, int maxSizeMB, PrefetchStrategy strategy, PrefetchEvictionPolicy eviction)
    Parameters
    Type Name Description
    int maxItems
    int maxSizeMB
    PrefetchStrategy strategy
    PrefetchEvictionPolicy eviction

    CaptureForReload()

    Snapshots every row's unsaved edits before a domain reload — see Serenity.Global.Infrastructure.Editor.SerenityWizardDraftListLifecycle`1.CaptureForReload.

    Declaration
    public void CaptureForReload()

    DescribeDeletedSourceSummaryLines(string)

    The Summary line for each row created only because its original profile asset was deleted.

    Declaration
    public List<string> DescribeDeletedSourceSummaryLines(string profilesFolderPath)
    Parameters
    Type Name Description
    string profilesFolderPath
    Returns
    Type Description
    List<string>

    Dispose()

    Declaration
    public void Dispose()

    DrawAddRowButton()

    Declaration
    public void DrawAddRowButton()

    DrawRows(string)

    Declaration
    public void DrawRows(string profilesFolderPath)
    Parameters
    Type Name Description
    string profilesFolderPath

    EnsureBuilt(Func<List<SerenityWizardScratchDraft<PrefetchPolicyProfile>>>)

    Declaration
    public SerenityWizardDraftListBuildOutcome EnsureBuilt(Func<List<SerenityWizardScratchDraft<PrefetchPolicyProfile>>> buildFromSource)
    Parameters
    Type Name Description
    Func<List<SerenityWizardScratchDraft<PrefetchPolicyProfile>>> buildFromSource
    Returns
    Type Description
    SerenityWizardDraftListBuildOutcome

    Rebuild(Func<List<SerenityWizardScratchDraft<PrefetchPolicyProfile>>>)

    Declaration
    public void Rebuild(Func<List<SerenityWizardScratchDraft<PrefetchPolicyProfile>>> buildFromSource)
    Parameters
    Type Name Description
    Func<List<SerenityWizardScratchDraft<PrefetchPolicyProfile>>> buildFromSource

    RecomputeValidationCache(string)

    Forces a fresh folder scan — call whenever the destination folder, or the disk state under it, might have changed (the window's own RecomputeCachedValidation).

    Declaration
    public void RecomputeValidationCache(string profilesFolderPath)
    Parameters
    Type Name Description
    string profilesFolderPath

    RefreshDeletedSourceNotice(string)

    Names every row whose profile asset was deleted — where it was, where confirming creates it and how to skip it — or clears the notice while none was.

    Declaration
    public void RefreshDeletedSourceNotice(string profilesFolderPath)
    Parameters
    Type Name Description
    string profilesFolderPath

    RemoveRowAt(int)

    Removes the row at index exactly like its own "✕" button.

    Declaration
    public void RemoveRowAt(int index)
    Parameters
    Type Name Description
    int index

    SimulateDomainReloadForTests()

    Declaration
    public void SimulateDomainReloadForTests()

    SimulateScratchLosingDomainReloadForTests()

    Test seam: the harsher reload — see Serenity.Global.Infrastructure.Editor.SerenityWizardDraftListLifecycle`1.SimulateScratchLosingDomainReloadForTests.

    Declaration
    public void SimulateScratchLosingDomainReloadForTests()

    SubscribeToAssetChanges()

    Subscribes this instance to UnityEditor.ObjectChangeEvents.changesPublished so an external AssetDatabase change (a profile created, deleted or edited outside this window while it stays open) drops the row-binding cache instead of leaving it stale until the next explicit recompute — mirrors MenuTransitionTargetCatalog's own use of the same event. The caller (the window's own OnEnable) owns the matching UnsubscribeFromAssetChanges() call, unlike that project-wide static cache: this is a per-window instance, so an unmatched subscribe would leak a closed window's own reference into a static event forever.

    Declaration
    public void SubscribeToAssetChanges()

    TruncateSourcesMirrorForTests()

    Test seam: forces the row lifecycle's own source mirror back to empty while the scratch mirror stays populated — see Serenity.Global.Infrastructure.Editor.SerenityWizardDraftListLifecycle`1.TruncateSourcesMirrorForTests.

    Declaration
    public void TruncateSourcesMirrorForTests()

    UnsubscribeFromAssetChanges()

    Un-does SubscribeToAssetChanges() — the window's own OnDisable call.

    Declaration
    public void UnsubscribeFromAssetChanges()

    ValidateAllRowBindings(string)

    Every row's own binding check, gating Configure/Summary navigation and the primary action alike: a row bound to an existing profile may rename that SAME asset's Id freely, but never retype into an Id that already belongs to a DIFFERENT existing profile; a brand-new row may never silently claim an untracked existing profile's Id either.

    Declaration
    public string ValidateAllRowBindings(string profilesFolderPath)
    Parameters
    Type Name Description
    string profilesFolderPath
    Returns
    Type Description
    string

    ValidateRowIdField(string, int, string)

    The per-row Id field's validation rule — mirrors PrefetchPolicyCreator's own private row-vs-row duplicate check (required, then a case-insensitive check against every other row — Ids become file names, and file systems collide on case), via the shared Serenity.Global.Infrastructure.Editor.SerenityWizardFieldRules.UniqueWithinRows(System.Int32,System.Collections.Generic.IReadOnlyList{System.String},System.String,System.Func{System.Int32,System.String,System.String}) rule, plus this row's own binding check (see ValidateAllRowBindings(string)).

    Declaration
    public string ValidateRowIdField(string profilesFolderPath, int index, string candidateId)
    Parameters
    Type Name Description
    string profilesFolderPath
    int index
    string candidateId
    Returns
    Type Description
    string

    Implements

    Serenity.Global.Infrastructure.Editor.ISerenityWizardDraftHolder
    In this article
    © 2026 Serenity. All Rights Reserved