1.9 KiB
1.9 KiB
MainMenuP0 Package Sample
MainMenuP0 is the minimal FlowScope package sample. It demonstrates the recommended bootstrap path for a small Unity project without introducing a full game template.
What It Covers
- Creating a root
Container. - Registering config, resource, save, audio, UI, preload, and screen navigation services.
- Registering
MainMenuFeaturewithRegisterTransient. - Preloading
MainMenuPanelthroughUIPreloadService. - Opening the main menu through
UIScreenNavigator. - Updating
PlayerData.Goldthrough R3-backed view data. - Saving data and releasing preloaded resources during
ShutdownAsync.
How To Import
In a consuming Unity project, open Package Manager, select FlowScope Game Core, and import the MainMenuP0 sample.
Do not import this package sample into the FlowScope development project while Assets/FlowScope/Samples/MainMenuP0 is still present. The development project keeps the Assets-based sample as the source of truth for tests during P2 migration.
How To Run
After importing the sample, open:
Assets/Samples/FlowScope Game Core/<version>/MainMenuP0/Scenes/MainMenuP0.unity
Enter Play Mode. The scene should show the main menu panel, a Gold text, and an increment button.
Validation Points
- The first startup shows default Gold.
- Clicking the button increments Gold immediately.
ShutdownAsyncwrites themain-menu-playersave.- Restarting restores the last saved Gold.
- Shutdown releases preloaded UI resources.
- Console has no unexpected Error or Exception.
Current Limits
- The sample uses
SampleResourceBackendinstead of real Addressables assets. - Runtime fallback UI exists so the sample can still run if scene or prefab references are missing.
- P2 package tests are not migrated yet; current automated tests still live under the FlowScope development project's
Assets/FlowScope/Tests.