Inheritance
MenuServiceSettingsCreator
Assembly: Serenity.UnityMenu.Infrastructure.Editor.dll
public static class MenuServiceSettingsCreator
Fields
File name (without extension) for a brand-new settings asset when the caller names none.
Declaration
public const string DefaultAssetName = "MenuServiceSettings"
Field Value
These two defaults — through DefaultBorderMargin — mirror the exact values on the
package's own shipped reference asset, Assets/Serenity/Media/Menu/MenuServiceSettings.asset,
because UnityMenuServiceSettingsDefinition declares no field initializers of its own
(a bare Assets ▸ Create asset is all zeros/empty). MenuServiceSettingsCreator.Input's field initializers
and the wizard window's serialized field initializers both reference these constants instead of
repeating the values, so a retune of the shipped asset only ever needs to change one place.
Declaration
public static readonly Vector2 DefaultBorderMargin
Field Value
These two defaults — through DefaultBorderMargin — mirror the exact values on the
package's own shipped reference asset, Assets/Serenity/Media/Menu/MenuServiceSettings.asset,
because UnityMenuServiceSettingsDefinition declares no field initializers of its own
(a bare Assets ▸ Create asset is all zeros/empty). MenuServiceSettingsCreator.Input's field initializers
and the wizard window's serialized field initializers both reference these constants instead of
repeating the values, so a retune of the shipped asset only ever needs to change one place.
Declaration
public const string DefaultControllerId = "MenuController"
Field Value
Identifier written onto a brand-new settings asset when the caller names none.
Declaration
public const string DefaultId = "menuService"
Field Value
Default output folder for a brand-new settings asset — under the game's content root,
matching every other singleton settings creator (ScoreSettingsCreator, SoundMixerSettingsCreator).
Declaration
public const string DefaultOutputFolder = "Assets/Game/Media/Menu"
Field Value
Methods
Validates the request, then either updates the existing asset named by
Input.ExistingSettingsAssetPath or creates a brand-new one. On any failure during
creation every mutation is rolled back so the project is left untouched.
Declaration
public static MenuServiceSettingsCreator.Result Create(MenuServiceSettingsCreator.Input input)
Parameters
Returns
The part of a creation run that happens inside a transaction: ensures the output folder, creates
the asset and verifies it landed on disk, without committing or rolling back anything itself.
Exposed so MenuCreator can fold the settings singleton's creation into its OWN
transaction alongside the menu drafts, instead of this class committing (or rolling back) a
separate transaction first.
Declaration
public static string CreateNewWithin(MenuServiceSettingsCreator.Input input, SerenityAssetCreationTransaction transaction)
Parameters
Returns
| Type |
Description |
| string |
The path the asset was created at.
|
Thin wrapper over the shared ResolveSettingsContext<TSettings>(string, string),
exposed so the window can auto-detect the project-wide singleton for its "Edit existing" field, and so
MenuCreator can resolve its own get-or-create target scoped to a single folder (a test's
temp folder, or the caller's configured Input.OutputFolderPath) instead of the whole
project.
Declaration
public static SettingsAssetAuthoring.SettingsResolution<UnityMenuServiceSettingsDefinition> ResolveSettingsContext(string explicitSettingsAssetPath = "", string searchRootFolder = null)
Parameters
| Type |
Name |
Description |
| string |
explicitSettingsAssetPath |
|
| string |
searchRootFolder |
|
Returns
Updates the already-validated existing asset named by Input.ExistingSettingsAssetPath
in place. Exposed so MenuCreator can update the singleton it resolved on its own, without
paying for a second Validate(Input) pass over an input it already validated itself.
Declaration
public static MenuServiceSettingsCreator.Result UpdateExistingInPlace(MenuServiceSettingsCreator.Input input)
Parameters
Returns
Full validation, re-checked at creation time so Create(Input) is safe to call
independently of the window's live validation.
Declaration
public static SerenityCreationValidationResult Validate(MenuServiceSettingsCreator.Input input)
Parameters
Returns
| Type |
Description |
| SerenityCreationValidationResult |
|
Id-only validation, usable before a folder choice has been made.
Declaration
public static SerenityCreationValidationResult ValidateIdentity(MenuServiceSettingsCreator.Input input)
Parameters
Returns
| Type |
Description |
| SerenityCreationValidationResult |
|