Class MenuTransitionTargetCatalog
The one list of transition targets the project already offers: the go-back sentinel, every menu asset, every top-level composite view plus its "::"-qualified children, every cascade view, every leaderboard view and every achievements view. The TRANSITION Value dropdown, the menu inspector's own validation and the Menu Manager wizard's findings all read this list, so a target the dropdown offers can never be one the validators reject.
Inherited Members
Namespace: Serenity.Menu.Infrastructure.Settings.Editor
Assembly: Serenity.UnityMenu.Infrastructure.Editor.dll
Syntax
public static class MenuTransitionTargetCatalog
Remarks
Each answer costs several Addressables-wide asset scans, and the dropdown used to run all of them per
TRANSITION row per repaint — so the scan is cached for the editor session, the same shape
ScoreKeyOptionProvider and InstallableSystemSettingsResolutionCache use. The scan itself is
Serenity.Menu.Infrastructure.Settings.Editor.MenuTransitionTargetScan.Run(); this class is only the cache and the read API over its
result. Two events drop the cache, because neither alone covers what changes a target:
UnityEditor.EditorApplication.projectChanged reports an asset being imported, moved or deleted but
stays silent while an existing asset's own fields are edited in place, and
UnityEditor.ObjectChangeEvents.changesPublished reports exactly that — an id renamed in an inspector,
before it is ever saved. A caller that writes menu assets itself triggers one of the two, so it needs no
explicit Refresh().
Methods
KeyFor(UnityMenuSettingsDefinition)
The key a menu asset is listed under: its own guid, so a picked target survives the menu being renamed, falling back to its id for a menu that carries no guid yet — which is exactly what the dropdown's write then stores (an empty guid beside the id).
Declaration
public static string KeyFor(UnityMenuSettingsDefinition menu)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityMenuSettingsDefinition | menu | The menu asset to key. |
Returns
| Type | Description |
|---|---|
| string | The catalog key. |
KnownTargetIds()
The ids a transition may resolve to, for the validators that only need membership. A superset of ProjectTargets()'s values: a nested composite view is a legal target to write by hand even though the dropdown does not offer it, so validating against the dropdown's list alone would flag an authored target the runtime resolves perfectly well.
Declaration
public static IReadOnlyCollection<string> KnownTargetIds()
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<string> | Every reachable target id, as an ordinal set. |
MenusById()
Every UnityMenuSettingsDefinition asset in the project, keyed by its own Id (ordinal), riding the same session-cached scan as ProjectTargets(). On a duplicate id the first menu found keeps the key; the scanner's own id-collision findings are what surface that as an authoring error elsewhere.
Declaration
public static IReadOnlyDictionary<string, UnityMenuSettingsDefinition> MenusById()
Returns
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, UnityMenuSettingsDefinition> | Every project menu, by Id. |
NonMenuViewIds()
Every non-menu view id the project already resolves: a top-level composite view, one of its "::"-qualified descendant paths, a composite nested inside another (offered here even though ProjectTargets() deliberately omits it), every cascade view, every leaderboard view and every achievements view. Rides the same session-cached scan as KnownTargetIds(), of which this is exactly the non-go-back, non-menu subset.
Declaration
public static IReadOnlyCollection<string> NonMenuViewIds()
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<string> | Every known non-menu view id, as an ordinal set. |
ProjectTargets()
Every transition target the dropdown offers, in dropdown order, cached for the editor session. A composite view nested inside another is deliberately absent: it is reachable only through its host's "::" path, so offering it alone would name a view no transition can open.
Declaration
public static IReadOnlyList<MenuTransitionTargetCandidate> ProjectTargets()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<MenuTransitionTargetCandidate> | The candidates, go-back first. |
Refresh()
Drops the cached scan so the next request re-scans the project.
Declaration
public static void Refresh()