MainMenuView<TSaveData, TSaveMetadata> is an abstract UIViewComponent that wires up Continue / Load / New Game / Settings / Credits / Quit buttons. Continue and Load are auto-enabled based on whether a save exists, queried through the GameSave manager you provide.

Q<Button>(...) lookups):
ButtonContinueButtonLoadButtonNewGameButtonCreditsButtonSettingsButtonQuitMainMenuView<TSaveData, TSaveMetadata> for your save types and implement GetSaveManager() plus the six OnButton...Clicked abstracts.GetSaveManager().public class MyMainMenuView : MainMenuView<MyGameSaveData, MyGameSaveMetadata>
{
[SerializeField] private MyGameSaveManager _saveManager;
protected override GameSaveManager<MyGameSaveData, MyGameSaveMetadata> GetSaveManager()
=> _saveManager;
protected override void OnButtonContinueClicked()
=> _saveManager.LoadFromSlot(LastSaveSlot, /* loadScene */ true);
protected override void OnButtonLoadClicked() => OpenLoadView();
protected override void OnButtonNewGameClicked() => StartNewGame();
protected override void OnButtonCreditsClicked() => OpenCreditsView();
protected override void OnButtonSettingsClicked() => OpenSettingsView();
protected override void OnButtonQuitClicked() => Application.Quit();
}Type signature:
namespace CupkekGames.Systems.UI;
public abstract class MainMenuView<TSaveData, TSaveMetadata> : UIViewComponent
where TSaveData : IGameSaveData, IData, new()
where TSaveMetadata : GameSaveMetadata| Property | Type | Description |
|---|---|---|
GameSaveManager | GameSaveManager<TSaveData, TSaveMetadata> | The manager returned from GetSaveManager(). |
LastSaveMetadata | TSaveMetadata | Metadata for the most-recent save (null if none). |
LastSaveSlot | int | Slot index of the most-recent save. |
_buttonContinue, _buttonLoad, _buttonNewGame, _buttonCredits, _buttonSettings, _buttonQuit — the resolved Button instances. Available after Awake().
| Method | Called when |
|---|---|
GetSaveManager() | Once during Awake() to fetch your GameSaveManager. |
OnButtonContinueClicked() | Continue button clicked. |
OnButtonLoadClicked() | Load button clicked. |
OnButtonNewGameClicked() | New Game button clicked. |
OnButtonCreditsClicked() | Credits button clicked. |
OnButtonSettingsClicked() | Settings button clicked. |
OnButtonQuitClicked() | Quit button clicked. |
OnEnable() / OnDisable() — wire/unwire button handlers and set initial focus. If you override, call base.OnEnable() / base.OnDisable().
When the view awakens, GetSaveManager().GetLastMetadata() is called once. The result decides:
_focusName = "ButtonContinue", Continue + Load enabled, Continue gets initial focus._focusName = "ButtonNewGame", Continue + Load disabled, New Game gets initial focus.GameSaveManager<T,M> interfaceSettings
Theme
Light
Contrast
Material
Dark
Dim
Material Dark
System
Sidebar(Light & Contrast only)
Font Family
DM Sans
Wix
Inclusive Sans
AR One Sans
Direction