Editor ExtensionCustomize the package's inspectors, drawers and tooling.

Editors, drawers & GUI

PersistenceManagerEditor

EditorextendingPersistentAsset.Editor

Base editor giving a custom PersistenceManager the standard inspector (Problems, Serializer, Parameters, Actions, Status, Save Data). Inherit it with a [CustomEditor] and override a Draw* hook; call base to keep the standard content. Worked example: A custom inspector.

Public
void DrawAsChild()Draw what a composite manager's row has to show about the manager it owns: what is wrong with it, and nothing else. Give the row a button selecting that manager, so its settings are edited in its own inspector. Its settings are deliberately not drawn in the row: a section inside a row indents twice over and shares its folded state with the owner's section of the same name.
For implementers (protected)
virtual void OnEnable() (protected)Creates the section foldouts. Call base when overriding.
PersistenceManager PersistenceManager / PersistenceManager[] PersistenceManagers (protected)The inspected manager (the first one when several are selected) and all of them, mirroring target / targets.
virtual void DrawParameters() / DrawActions() / DrawStatus(PersistenceManager selected) (protected)Those sections; override to customize (call base to extend).
virtual void DrawProblems() (protected)Everything wrong with this manager, as one block above the parameters. The default draws the package's own checks; override to add yours (call base first), reading every value it depends on before drawing a field that can change one.
bool ShowParameters / ShowActions / ShowStatus / ShowSaveData (protected virtual)Whether each section is shown at all; all four are true by default.
MessageType? ParametersMessage (protected virtual)The worst message the Parameters section holds, groups included, marked on its header while it is folded. The default is the worst message the base parameter groups hold, so fold it into yours with PersistenceManagerEditorGUI.Worst(base.ParametersMessage, ...) when overriding. Answer it whether the section is open or not: a value taken from the drawing could only ever be right when everything is already visible. Manager-level problems belong in DrawProblems, which is always in view.
virtual void DrawSerializer() / bool ShowSerializer (protected)Serializer section, a category of its own above the parameters and collapsed by default: it is the one setting most projects choose once and never revisit, and the one that decides the shape of every save. Shown by default whenever the manager has a serializer field.
virtual void DrawSaveData(PersistenceManager selected) (protected)The Save Data section: what storage holds for a slot, next to what a save would write. Override to add your own.
IReadOnlyCollection<BuildTarget> UnsupportedBuildTargets (protected virtual)Platforms this manager cannot persist on (shows an error box); empty by default.
PersistenceManager[] LockedTogether (protected virtual)The managers the lock row locks as one, the inspected ones by default. A composite manager's editor adds the managers it owns.

RemotePersistenceManagerEditor

EditorextendingPersistentAsset.Editor.BuiltIns

Base editor for a RemotePersistenceManager subclass: the standard manager inspector plus the offline-cache, compression and security parameters. Used automatically for any remote manager without a more specific editor. Explained in Extend the package.

Public
string CacheTitle / FormatTitle (const)Those two group titles.
For implementers (protected)
override void OnEnable() (protected)Finds the cache parameters. Call base when overriding.
override void DrawParameters() (protected)Adds the Offline Cache and Format & Protection groups to the Parameters.
void DrawCacheGroup() / DrawFormatGroup() (protected)The two folding groups the standard remote inspector places: Offline Cache around the cache fields, and Format & Protection around compression and security, under the name the file manager gives the same pair. Call these from a DrawParameters override; the three methods below draw the fields themselves, for an editor placing them its own way.
void DrawCacheParameters() (protected)Draw the Cache Mode (and Offline Cold Start) fields; place it from a DrawParameters override.
void DrawCompressionParameter() (protected)Draw the Compression field. It belongs right above DrawSecurityParameters, the order the two are applied in.
void DrawSecurityParameters() (protected)Draw Encryption and Anchor Save To, then Cache Encryption and Cache Anchor Save To while the manager keeps a cache, each with its per-anchor warnings, plus the error for a setting a remote manager refuses. Does nothing when the manager exposes none of them.

SlotRegistryEditor

EditorextendingPersistentAsset.Editor

Base editor for PersistentSlotRegistry and its subclasses: draws your fields, then the read-only slot entries. Inherit with a [CustomEditor].

virtual void OnEnable() (protected)Creates the section foldouts. Call base when overriding.
virtual void DrawProperties() (protected)Override DrawProperties to control the fields shown above the entries (call base to keep the default).

PersistentVariablesEditor

EditorextendingPersistentAsset.Editor.NoCode

Base editor for PersistentVariables and its subclasses: draws the non-variable fields, then the variable list. Inherit with a [CustomEditor].

virtual void OnEnable() / OnDisable() (protected)Reads the serialized properties, creates the foldouts and builds the variable list; the second drops the runtime subscriptions. Call base when overriding.
PersistentVariables Variables (protected)The inspected asset, mirroring target.
virtual void DrawProperties() / virtual string[] HandledProperties (protected)Override (or extend the excluded set) to customize the fields shown above the list.
virtual bool ShowGlobalIdentifier (protected)Whether the Global Identifier field is drawn (true by default). Return false on a subclass reached by its own type rather than by an identifier, where the field would name nothing. One already stored is drawn either way, so it can be seen and cleared.

PersistentSceneStateEditor

Editorextending2.0PersistentAsset.Editor.SceneObjects

Base editor for PersistentSceneState and its subclasses: draws the asset's own settings, then what the state currently holds, one row per scene. Inherit with a [CustomEditor].

virtual void OnEnable() (protected)Creates the section foldouts. Call base when overriding.
virtual void DrawProperties() (protected)Every serialized field except the records, which are shown as the summary below instead. Override to control what appears above the summary (call base to keep the default).

SerializerDrawer

drawerextendingPersistentAsset.Editor

The PropertyDrawer for every Serializer field (a type popup, then the selected type's fields). Inherit + [CustomPropertyDrawer(typeof(YourSerializer))] to customize. It already implements GetPropertyHeight and OnGUI, which draw the popup and delegate the rest to the two members below: override those, not the PropertyDrawer pair. Worked example: A custom serializer drawer.

virtual float FieldsHeight(SerializedProperty) / virtual void DrawFields(Rect, SerializedProperty) (protected)Override to draw the serializer's fields below the type popup.

PersistenceManagerEditorGUI

staticextendingPersistentAsset.Editor

Building blocks to draw a PersistenceManager inspector by hand (the manager-agnostic helpers live in PersistentAssetEditorGUI). Explained in Extend the package.

IReadOnlyList<string> NonParameterFieldsProperty paths that are not parameters (script, target, id, import and composition plumbing), to exclude when drawing custom fields.
IReadOnlyList<string> DrawBaseParameters(SerializedObject)Draw the exposed base parameters, folded into the Slots & Scope, Automatic Load & Save and Execution & Timeouts groups; a group none of whose parameters the manager exposes is not drawn. Returns the paths drawn, the serializer's included: it is drawn by the Serializer section, and a custom editor excluding these paths must not draw it a second time.
MessageType? BaseParametersMessage(SerializedObject) · MessageType? Worst(params MessageType?[])The worst message the groups DrawBaseParameters draws are holding, so a section can answer for what it folds away, and the same reduction over messages of your own: null is nothing to say, and an error outranks a warning outranks information.
bool DrawChildBanner(PersistenceManager[])The banner for managers owned by a composite one: what they are part of, and a button that selects it. Returns whether it drew, which is also whether the inspector should skip everything that needs a session.
string SlotsAndScopeTitle / AutomaticTitle / ExecutionTitle (const)The three group titles, so a custom editor can place its own fields in them or leave those names alone.
void DrawBaseProperty(SerializedProperty)Draw one base parameter with its standard presentation.
SerializedProperty SerializerParameter(SerializedObject) / void DrawSerializerParameter(SerializedObject)The manager's serializer field, and its standard drawing, for the Serializer section. Both answer with nothing for an owned manager, which serializes through its owner's.
void DrawProperty(SerializedProperty) / DrawProperty(SerializedProperty, GUIContent)Draw a field, auto-locked when it is a [Breaking] field and the manager is locked.
void DrawTargetHeader(Editor)Draw the header naming the object this manager saves.
bool DrawImportSourceInspector(Editor)Draw the read-only inspector of an import source, and answer whether the manager was one, so a caller can skip its own drawing.
void DrawActions(PersistenceManager[], ref bool newSlotEnabled, ref string newSlot)Draw the slot row and the Load, Save and Clear buttons.
PersistenceManager DrawSelector(PersistenceManager[], ref int selectedIndex)Draw the selector that picks which manager the sections below act on, when several objects are inspected at once.
bool ActionButton(GUIContent) / int ActionButton(GUIContent, GUIContent second)An action of this manager's own, on a row of its own: the button takes the value column, lining up with the Load, Save and Clear rows above it. The two-argument form shares the row between two actions, the way Sync and Async do, and answers 0, 1 or -1 for which was pressed.
void DrawStatus(PersistenceManager)Draw the status rows: readiness, slot, storage location and the last operation.
void DrawLogs(PersistenceManager, ref float scrollPosition)Draw the scrolling operation log, the editor and development-build view of what the manager did.
void DrawSaveData(PersistenceManager, SaveDataState) · class SaveDataStateDraw what storage holds next to what the object holds, read on demand through the manager's own read. Keep one state object per editor.
void DrawLockRow(PersistenceManager[])Draw the lock toolbar, the row that marks a manager as shipped.
bool IsLocked(PersistenceManager)Whether a manager is locked, so your own fields can go read-only with the rest.
void DrawBreakingLockIcon(Rect, SerializedProperty) / bool IsBreakingFieldLocked(SerializedProperty)Draw / query the padlock for a [Breaking] field.
struct BreakingFieldScope : IDisposable · BreakingFieldScope(params PersistenceManager[])A using block that mirrors the managers' locked state onto every field drawn inside it.
struct GroupScope : IDisposable · GroupScope(string title, MessageType? message = null, SerializedObject = null, params string[] paths) · bool Visible { get; }A folding group of parameters, for the settings a manager works without: draw the two or three fields with no useful default above it and group the rest. Its open state is remembered per title, and a collapsed group whose values differ from a fresh manager's marks itself configured, which is what keeps a folded setting discoverable. Outside a manager inspector, use PersistentAssetEditorGUI.GroupScope, the same group without the mark.
void DrawPersistenceDisabledError(PersistenceManager[]) / DrawPolicyConstraintConflictError(PersistenceManager[]) / DrawStorageLocationConflictError(PersistenceManager[])Error boxes for a disabled manager / a policy-versus-constraint conflict / a manager resolving to the same storage location as another one in the project.
void DrawMissingSerializerTypeError(PersistenceManager[])Error box while an inspected manager stores a serializer whose type does not resolve here: its module is not compiled in the project, or the type was renamed with no [MovedFrom]. The serializer is named rather than shown as an empty field, and kept rather than replaced, since the saves it wrote cannot be read without it.
void DrawTestManagerBox(PersistenceManager[])Warning box and exit button of a test manager (restores the kept setup it replaced, or removes it); draws nothing for any other manager.

ManagerComposition

staticextending2.0PersistentAsset.Editor

Authoring support for a manager made of other managers (see Platform (Routing)). An owned manager is a hidden sub-asset of the same object and never runs on its own: its owner drives its storage. One level deep, and an owned manager nothing references is swept away. Worked example: A manager whose storage is other managers.

bool IsChild(PersistenceManager) / PersistenceManager OwnerOf(PersistenceManager) / PersistenceManager[] ChildrenOf(PersistenceManager)Whether a manager is owned, by which one, and what a manager owns.
void AsOneEdit(Action edit)Run an edit as a single undo step. Wrap every change a composite manager's editor makes in this: one of them touches its own routing, a child asset and the names carrying the order, and an undo landing between two of those leaves a part pointing at nothing, or a manager nothing references that the project then reports as leftover garbage.
PersistenceManager CreateChild(Type, PersistenceManager owner)Create an owned manager. Reference it from the owner in the same operation.
void DeleteChild(PersistenceManager) / AdoptChild(PersistenceManager, PersistenceManager owner)Delete an owned manager; make an existing manager an owned one, keeping everything it holds.
PersistenceManager Compose(PersistenceManager, Type compositeType) / bool CanCompose(PersistenceManager)Put an object's manager under a new composite one that takes its place: it keeps its identity, its configuration and the storage it already writes, so a shipped save is never stranded. Reference it from the composite in the same operation, as with CreateChild.
void NameChild(PersistenceManager, string prefix)Name an owned manager "[prefix] Type", since the asset file cannot nest one manager under another.
IReadOnlyCollection<BuildTarget> UnsupportedBuildTargetsOf(PersistenceManager)What a manager's own editor vetoes, so a composite can report a part pointed at a platform it does not support.

PersistentAssetEditorGUI

staticextendingPersistentAsset.Editor

General editor GUI building blocks with no PersistenceManager dependency: titles, foldouts and the groups that fold inside them, hinted float fields and build-target groups.

void DrawTitle(string title, bool space = true)Draw a bold section title.
void SelectableField(GUIContent label, GUIContent value) / SelectableField(Rect rect, GUIContent label, GUIContent value)Draw a read-only value that looks like a text field and can be selected and copied. Use it for a resolved preview (a save path, a server address, a storage key) rather than a disabled label, which looks editable and hands back nothing.
void HintedFloatField(Rect, SerializedProperty, Func<float, string> hint, float? minimum = null, GUIContent label = null)A number field (float or int) with an in-field hint and an optional floor.
AnimBool CreateFoldout(Editor, string key, bool expandedByDefault = true)Create a persisted, animated foldout state (pair with FoldoutScope).
struct FoldoutScope : IDisposable · FoldoutScope(AnimBool foldout, string title, MessageType? message = null, string tooltip = null, string hint = null) · bool Visible { get; }A using-block animated foldout header + guarded content; wrap the body in if (scope.Visible). Alt-clicking it carries the toggle to the groups inside it, the way alt on a built-in foldout expands a whole property. tooltip says what the section is, over the whole header, and hint is a word or a count grayed at its right.
struct GroupScope : IDisposable · GroupScope(string title, MessageType? message = null, bool expandedByDefault = false, string hint = null) · bool Visible { get; }A using-block group that folds one level inside a FoldoutScope section: its content indents under a bold header, and its open state is remembered per title like a section's. Put the fields that work untouched in groups so the two or three a user must set stay in view. Drawn with no section around it, it takes the band and the flat content a section has instead. hint says what a closed group holds, grayed at the right of its header. PersistenceManagerEditorGUI.ParameterGroupScope is this one plus the configured mark.
void RepaintWhileGroupsAnimate(Editor)Carry the tween of any group that is opening or closing. Call it at the end of an OnInspectorGUI that draws a GroupScope; without it the fade stalls wherever the last repaint left it.
bool AnyGroupAnimating { get; }Whether a group anywhere is opening or closing right now. An inspector that carries the tween itself, rather than calling RepaintWhileGroupsAnimate, reads this to decide whether it still needs to repaint.
GUIStyle HintStyle { get; }The style an annotation takes: the gray mini label, right aligned, that a FoldoutScope or GroupScope header hint reads in. Use it for a word at the right of a row rather than an alpha chosen per call site.
bool SecondaryButton(GUIContent) · float SecondaryButtonWidth(GUIContent)A mini button sized to its own label, which is what Foundations asks of a secondary action, and the width it would take for a row placing its controls by hand. Put a GUILayout.FlexibleSpace before it so it sits at the right of its row.
GUIStyle NoteStyle { get; } · void DrawNote(GUIContent)Gray annotation text, left aligned and wrapping, for a note standing where a control or a readout would be: what an empty section holds instead of empty fields. DrawNote reserves the height the wrapping needs, where a label field would cut it off after one line.
bool IsEvent(SerializedProperty) · int ListenerCount(SerializedProperty unityEvent) · string ListenerHint(int count)Whether a property is a UnityEvent, how many persistent listeners it carries, and that count worded for a collapsed group's hint ("None", "1 listener", "4 listeners").
void FolderField(Rect, SerializedProperty folderPath, GUIContent label, string emptyHint = null, bool createdOnDemand = false)Draw a string property as a project folder: the path under Assets, typed or picked or dropped in. Assets/ is a fixed lead-in and the value stores the whole "Assets/..." path; anything that is not a folder under Assets is refused. Clicking the icon reveals the folder in the project window. emptyHint is the grayed text an empty field shows ("None" without one), and a path with no folder behind it is kept and marked with a warning unless createdOnDemand says the setting names a folder its own feature creates. Every folder setting in the package draws through this; FolderPath applies it to a field with no code.
void DrawUnsupportedBuildTargetError(IReadOnlyCollection<BuildTarget>)Error box while the active build target is unsupported.
IReadOnlyList<BuildTarget> ConsoleBuildTargets / MobileBuildTargets / WebGLBuildTargetsReady-made target groups to veto from a manager.

SecurityGUI

staticextendingPersistentAsset.Editor.BuiltIns

Shared drawing of the Encryption + Anchor Save To fields for managers reusing CheatProtectionUtility.

void DrawFields(SerializedProperty encryptionProperty, SerializedProperty anchorSaveToProperty)Draw Encryption and (when on) the Anchor Save To field with per-lock warnings.
void DrawFields(…, SaveAnchor unavailableAnchors) / DrawFields(…, SaveAnchor unavailableAnchors, IReadOnlyList<Encryption> unavailableEncryptions)The same, leaving out the anchors and modes your manager cannot honor, so a setting it refuses is never offered. One already set stays listed and selected, with its error, so only a deliberate edit clears it.
void DrawEncryptionField(SerializedProperty, IReadOnlyList<Encryption> unavailableEncryptions)The Encryption field on its own, for a manager exposing it without an Anchor Save To field.
void DrawAnchorSaveToField(SerializedProperty, SaveAnchor unavailableAnchors)The Anchor Save To field on its own, for the reverse case.
MessageType? WorstMessage(SerializedProperty encryptionProperty, SerializedProperty anchorSaveToProperty)The worst message DrawFields draws for these values, or none. Ask it before the fields, to mark a folded group holding them.

SlotFormatGUI

staticextendingPersistentAsset.Editor.BuiltIns

Shared drawing for fields accepting the "<slot>" placeholder (the file manager's file name, the HTTP id).

string MultiSlotHelpText(string usage)The help-box text explaining the placeholder.
void DrawField(SerializedProperty, IReadOnlyList<PersistenceManager>, string multiSlotHelpText)Draw the field (empty value ghosts the unique id).
void DrawValidationError(string reason)Draw an invalid-name error box (null = valid).

SerializedObjectExtensions

staticextendingPersistentAsset.Editor.BuiltIns

Find the serialized backing field of a [field: SerializeField] auto-property by its property name.

SerializedProperty FindBackingField(this SerializedObject, string propertyName)The backing property on a serialized object.
SerializedProperty FindBackingFieldRelative(this SerializedProperty, string propertyName)The backing property relative to a serialized property.

VariableWidget / VariableWidget<T>

abstractextendingPersistentAsset.Editor.NoCode

Base for a custom inspector editor of a No-Code variable value. Pair it to a codec id with [VariableWidget]; prefer the typed VariableWidget<T>, which handles the codec round trip. Worked example: Custom inspector widgets.

Public
abstract string Draw(Rect, GUIContent, VariableTypeCodec, string value)(base) Draw an editor for the stored string; return the edited string.
virtual float GetHeight(GUIContent, string value)Height needed (one line by default).
[VariableWidget(string id)] · string IdAttribute binding a widget to a codec id.
For implementers (protected)
protected abstract T Draw(Rect, GUIContent, T value)(VariableWidget<T>) Draw a typed value editor.

TypeDisplay

structextendingPersistentAsset.Editor

The inspector display info read from a type's [InspectorDisplay] (with sensible defaults). Shared by the type pickers to label, sort and group entries.

string Name / Description { get; }, int Order { get; }, string Category { get; }The resolved display fields.
GUIContent Content { get; } / string MenuPath { get; } / GUIContent MenuContent { get; }Ready-made label content, its submenu path, and the labeled menu content for a picker.
static TypeDisplay Of(MemberInfo member, string fallbackName = null)Read a type's or method's display info.
static IEnumerable<(Type type, TypeDisplay display)> OrderedDerivedFrom(Type baseType)Concrete derived types ordered for a picker, with the ones declared in a test assembly left out.

AssetRegistration

staticPersistentAsset.Editor

The editor side of AssetRegistry: it decides which assets save data may point at, and keeps the table the runtime reads in sync with the project. Use it to register assets from your own editor tooling. See Save asset references.

string Register(Object asset)Registers an asset and returns its id (null when it cannot be registered, such as a scene object). Idempotent.
void Unregister(string id)Unregisters an id. Saved references to it stop resolving.
string RegisterForTool(Object asset, string owner = null)Registers an asset your own tooling maintains, so the same tooling can take the entry back later. A manual entry is left as it is. One a registered folder or a reference produced is claimed, so the pass that recomputes those cannot take the registration away. owner names the tooling making the claim: pass a constant of your own, and the same one to UnregisterForTool, so an asset two tools need survives the first taking its claim back. Naming none claims the entry under the unnamed owner, which every call naming none shares.
void UnregisterForTool(Object asset, string owner = null)Takes back the claim RegisterForTool made under the same owner. Includes one it claimed from a registered folder or a reference, which the next refresh re-derives. The entry goes with the last claim on it, so an asset other tooling still claims stays registered. Another tool's claim is not one of yours to remove, and an entry the user added by hand is left alone.
IDisposable Batch()Groups registrations so the settings file is written once at the end instead of once each. Wrap a run of them in using. IsRegistered is not authoritative inside a batch, since the table it reads is only rebuilt when the batch closes.
string ComputeId(Object asset)The id an asset would be registered under (its GUID, plus the local file id for a sub-asset), without registering it.
Object Resolve(string id)The asset an id points at, for display: the registry answers first, then the project, so an asset that lost its registration still shows.
bool IsRegistered(Object asset) / void Refresh()Whether an asset can be saved, and a full pass over the registered folders and the deleted assets (runs by itself after an import and at the start of a build, and does nothing in play mode).

Object & manager operations

PersistentObjects

static2.0PersistentAsset.Editor

Acting on persistent assets from an editor script of your own: whether an object is one, which manager it is assigned, creating one as an asset, and listing the project's. The manager assets themselves are ManagerSetup.

bool IsPersistent(Object target)Whether it is a PersistentScriptableObject, or any ScriptableObject carrying [PersistentScriptableObject].
PersistenceManager GetManager(Object target)The manager assigned to it, what the dropdown at the top of its inspector shows. Null when it has none or is not a persistent asset.
void SetManager(Object target, PersistenceManager manager)Points the object at a manager and saves the asset, undoable. Refuses one that answers for another object, one that is inert (an import source, a composite's child), and null, since clearing the field alone does not last: the manager asset stays and the editor assigns it back. ManagerSetup.Delete is how an object ends up with none.
bool CanCreate(Type type)Whether an asset of that type can be made at all: a concrete ScriptableObject that is not generic. Both Create methods answer null for a bad type and for a bad folder alike, so this is how the two are told apart.
ScriptableObject Create(Type type, string folder, string fileName)Creates the asset in an existing "Assets/..." folder, with the project's default manager on it. A taken name is made unique. Null when the type is not a concrete ScriptableObject, the file name is not usable as one, or the folder is not one. Lets out whatever writing the asset raises, and whatever the default Persistence Manager's own code raises while it is attached; the asset is on disk when the second happens, without a manager.
void DeclareProvided(Type type)Declare that the asset for that type is provided rather than made by hand: generated by the package, shipped with a sample, or created by your own tooling. Create > Persistent Asset > Persistent Object… then leaves it out, so its one asset is not offered a second time. Call it from an [InitializeOnLoad] static constructor, since the declaration lives for the editing session rather than on disk. It changes nothing else: Create still makes one when asked.
bool IsProvided(Type type)Whether DeclareProvided was called for that type.
IEnumerable<Object> FindAll()Every persistent asset in the project, in path order, both forms covered. One whose manager is None is included. A snapshot from a project scan the package keeps until a manager asset is imported or play mode changes, so one deleted by other means can still appear until Unity destroys the instance.

ManagerSetup

static2.0PersistentAsset.Editor

Acting on Persistence Manager assets from an editor script. A manager lives as a sub-asset of the object it answers for, which these take care of. Composites are ManagerComposition.

PersistenceManager EnsureDefault(Object target)Gives the object the project's default manager when it has none, the way the editor does for one created by hand. Returns the manager it has afterwards, null when it is not a persistent asset or the project default is None. A manager given during play mode starts saving and loading at the next play session.
PersistenceManager Create(Type type, Object target)Creates a manager of that type and assigns it, replacing the one the object had, as one undo step. An object already using that exact type keeps the manager it has, so this is safe to run over a whole project. The replaced manager is kept as an import source when it is locked and stores its saves durably, the same signal the inspector prompts on, and deleted otherwise. Replacing the manager of an object that already shipped changes where its data is read from, so an existing save is only still found through the import source, and only for as long as that source is kept.
void Delete(PersistenceManager manager)Deletes the manager asset, and the children it owns when it is a composite. Undoable. A composite's child is refused and reported: change what the composite holds through ManagerComposition.
IEnumerable<PersistenceManager> FindAll(bool includeImportSources = false)Every manager asset in the project, import sources left out unless asked for. A snapshot from a kept project scan, like the one above.

GeneratedAssets

static2.0PersistentAsset.Editor

The folder the package creates the assets it generates for a project in (the Prefs asset), set under Project Settings > Persistent Asset > General, and the one way to create an asset there.

const string DefaultFolderAssets/Persistent Asset Data, where generated assets go while the setting is empty. Outside the package because each of these assets carries the id its saves are addressed by.
string Folder { get; }The configured folder as an "Assets/..." path, Assets/Persistent Asset Data when the setting is empty, or null when the setting names nothing under Assets. It may not exist yet.
ScriptableObject Create(Type type, string fileName)PersistentObjects.Create into that folder, creating the folder (and its README) when it is missing. Never throws: a failure is reported and answered with null.

Project settings

SettingsEntry

abstractextendingPersistentAsset

Base class for a settings section. Subclass it as [Serializable] with a parameterless constructor, its field initializers being the defaults, and decorate it with [InspectorDisplay] for the section title and ordering. Worked example: Custom settings.

Settings

staticPersistentAsset

Static access to the package settings (Project Settings > Persistent Asset). Explained in Project settings.

Members
bool Loaded { get; }Whether the configured settings are available. True in the editor unless the settings file exists but could not be read; in a player it turns true when the settings shipped with the build finish loading, before the first scene, so only code running earlier (typically the automatic load of a preloaded persistent asset) can observe false. While false, Get answers defaults: an operation whose outcome must match the configured values (deriving a key from the security secret) should fail and retry instead of proceeding on them.
T Get<T>() where T : SettingsEntry, new()The project's instance of a settings section (or a default). Treat the result as read-only: runtime changes to it are not persisted.
void Save()Persist settings changed from code. It writes nothing in a build, where the settings are read-only, and calling it there is harmless.

SettingsEntryDrawer

drawerextendingPersistentAsset.Editor

The PropertyDrawer for every SettingsEntry section (draws its fields flat). Inherit + [CustomPropertyDrawer(typeof(YourSettings))] to customize. It already implements GetPropertyHeight and OnGUI, which delegate to the two members below: override those, not the PropertyDrawer pair. Worked example: A custom settings drawer.

virtual float FieldsHeight(SerializedProperty) / virtual void DrawFields(Rect, SerializedProperty) (protected)Override to draw the section's content.

SettingsTestScope

sealed2.0PersistentAsset.Editor

Sends every settings read and write to a throwaway container for the life of the scope, so an EditMode fixture of your own registers assets and locks managers without the project's settings file ever holding what it did, not even when the editor crashes part way through a run. One scope stands at a time: opening another ends the one already open, so a fixture whose teardown never ran leaves nothing for the next one to inherit.

new SettingsTestScope()Opens a scope whose settings start out empty. Open it in the fixture's setup, or wrap a run of tests in using.
void Dispose()Ends the scope: everything written into it goes, and the project's own settings answer again.

Attributes

Attributes

attrextendingPersistentAsset.Editor
[ClearLocalData(Type persistenceManagerType)]
Type PersistenceManagerType { get; }
Mark a parameterless static method as a "clear local data" cleaner for a manager type, run from Tools > Persistent Asset > Actions > Delete Local Data…. The constructor throws ArgumentNullException when persistenceManagerType is null. Worked example: A "delete local data" cleaner.