|
Window Framework for UI Toolkit v2.0.x
|
Editor-only copying of theme source folders and their appearance assets. More...
Static Public Member Functions | |
| static void | Cleanup (List< string > created) |
| Deletes only paths created by a failed operation, deepest first. | |
| static WindowFrameTheme | CopyTheme (WindowFrameThemeData themeData, string sourceThemeId, string destinationFolderPath) |
| Copies a theme identified by stable ID and registers its independent copy without any Studio instance. | |
| static string | CreateFolder (string parent, string name) |
| Creates an unused child folder underneath an existing project Resources folder. | |
| static string | Duplicate (string sourceEntry, string destination) |
| Copies one complete theme folder and rebases its own asset references. | |
| static UnityEngine.Object | OwnAsset (UnityEngine.Object asset, string folder, string subfolder, List< string > created) |
| Copies a borrowed image into the theme and returns the independent object. | |
| static string | OwnReferences (string text, string origin, string folder, List< string > created) |
| Rewrites source artwork references to owned images, copying external images as needed. | |
| static string | ResourcePath (string path) |
| Returns the Resources key for a project asset, preserving folder identity. | |
Static Private Member Functions | |
| static UnityEngine.Object | CopyPreview (UnityEngine.Object asset, string sourceFolder, string destination, List< string > created) |
| static bool | Equal (byte[] first, byte[] second) |
| static string | Expression (string kind, string path, string quote) |
| static string | Normalize (string path) |
| static string | Resolve (string origin, string kind, string reference) |
| static string | ValidateFolder (string path) |
| static void | WriteSource (string path, string text) |
Static Private Attributes | |
| static readonly Regex | Reference = new Regex(@"(?<kind>resource|url)\(\s*(?<quote>['""'])(?<path>[^'""']+)\k<quote>\s*\)", RegexOptions.Compiled) |
Editor-only copying of theme source folders and their appearance assets.
Never copies the shared Resources parent as a theme. Source assets are borrowed, copies have independent GUIDs, and existing destinations are never overwritten. Shared application sheets remain the collection's responsibility. Loose player files are not handled.
|
inlinestatic |
Deletes only paths created by a failed operation, deepest first.

|
inlinestaticprivate |

|
inlinestatic |
Copies a theme identified by stable ID and registers its independent copy without any Studio instance.
| themeData | Public collection containing the source and receiving the copy. |
| sourceThemeId | Exact public WindowFrameTheme.StableId; names and indices are not identity. |
| destinationFolderPath | Full unused project-relative Assets/.../Resources/... theme folder. Parent must exist. |
| ArgumentNullException | Collection is null. |
| ArgumentException | ID/path is empty or path is invalid, absolute, traversing or inside the source. |
| InvalidOperationException | ID is missing/ambiguous or source has no project entry stylesheet. |
| IOException | Destination exists or copy/import/dependency processing fails. |
Editor-only trusted project authoring. Does not instantiate Studio, change editing/runtime selection, change defaults, or execute loose player files. Preserves source composition metadata; shared application styles remain collection-owned. Saves dirty collection metadata and returns the added record. Errors propagate without dialogs or automatic renaming. Failed operations remove their created folder/entry; original source and existing destination assets are never overwritten. Caller controls any subsequent selection/UI refresh. Filesystem/process crashes are not atomic.


|
inlinestatic |
Creates an unused child folder underneath an existing project Resources folder.
| parent | Project-relative existing parent. |
| name | Requested single folder name. |
| IOException | Invalid location, name, or existing destination. |


|
inlinestatic |
Copies one complete theme folder and rebases its own asset references.
| sourceEntry | Entry TSS in the independently owned source folder. |
| destination | Unused sibling/different project Resources folder path. |
| IOException | Copy, import, internal-reference remapping, or path validation fails. |
Failure removes only the created copy. Source bytes are checked before success. References outside the source folder are preserved, not copied or rejected for ownership. No catalog entries are modified here. Existing application stylesheet composition is not copied.


|
inlinestaticprivate |

|
inlinestaticprivate |


|
inlinestaticprivate |

|
inlinestatic |
Copies a borrowed image into the theme and returns the independent object.
| asset | Borrowed raster/vector image, or null for an explicitly empty role. |
| folder | Owned theme folder under Resources. |
| subfolder | Icons, Cursors, or Preview. |
| created | Operation-owned paths for cleanup if the caller's save fails. |
| IOException | Unsupported type or failed copy/import. |


|
inlinestatic |
Rewrites source artwork references to owned images, copying external images as needed.
| text | Complete source text, with developer content preserved. |
| origin | Original stylesheet path for relative references. |
| folder | Destination theme folder. |
| created | Created paths for caller rollback. |
Imports are preserved when already local. External source imports are refused, not silently shared.


|
inlinestaticprivate |


|
inlinestatic |
Returns the Resources key for a project asset, preserving folder identity.


|
inlinestaticprivate |


|
inlinestaticprivate |


|
staticprivate |