Class SystemAdoptionPlanner
Plans a shipped Serenity system's adoption into the user's own project: a breadth-first walk of the
settings asset's dependency closure (WalkClosure(string, Func<string, IReadOnlyList<string>>, Func<string, bool>, Func<string, bool>), one
UnityEditor.AssetDatabase.GetDependencies(System.String) non-recursive call per visited node), filtered to package
content that is not a script or assembly definition, with the shipped composition-root installer
prefab held out as an exclusion instead — the walk never descends into an excluded node, so its own
dependencies never enter the closure. Every OTHER identity-carrying prefab (a UI component prefab
implementing IFoundationSettings through FoundationUiComponent, for instance) is cloned
normally; SystemAdoptionRunner renames each of its identity-carrying components'
IFoundationSettings.Id and regenerates their Guid together, once cloning finishes — every
adopted asset is a new asset, prefab component or ScriptableObject alike. The settings asset
itself is not part of the walk's closure (it is the starting point, never one of its own dependencies),
so Plan(string, string) adds it as its own entry — SettingsAssetDestinationPath
depends on finding it in Entries. No cloning happens here —
SystemAdoptionRunner executes the plan this produces.
Inheritance
SystemAdoptionPlanner
Assembly: Serenity.UnityCreateGame.Infrastructure.Editor.dll
Syntax
public static class SystemAdoptionPlanner
Methods
Plan(IReadOnlyList<string>, string)
Multi-root counterpart of Plan(string, string): one closure walk shared by
every path in rootAssetPaths — used by "Adopt assets" to bring in every OTHER
shipped asset that belongs to a system in a single plan, instead of one plan per asset.
Declaration
public static SystemAdoptionPlan Plan(IReadOnlyList<string> rootAssetPaths, string outputRoot)
Parameters
Returns
Plan(string, string)
Builds the adoption plan for settingsAssetPath into outputRoot.
Declaration
public static SystemAdoptionPlan Plan(string settingsAssetPath, string outputRoot)
Parameters
| Type |
Name |
Description |
| string |
settingsAssetPath |
|
| string |
outputRoot |
|
Returns