This project showcases the implementation of a flexible and scalable Save/Load system. It supports saving player progress to PlayerPrefs and Yandex Games cloud storage. It also showcases the use of design patterns such as State Machine and Abstract Factory.
- Asynchronous loading support for Yandex Games cloud saving
- Modular and scalable architecture for easy maintenance and expansion
- Codebase using design patterns and clean code principles
SaveLoadService/ β βββ Data/ β βββ PlayerProgress.cs # Stores key gameplay data β βββ SavesYG.cs # Extends Yandex Games Plugin save system to support custom data β βββ Factory/ β βββ IGameFactory.cs β βββ GameFactory.cs # Handles object creation β βββ IStateFactory.cs β βββ StateFactory.cs # Creates and manages game states β βββ GameStateMachine/ β βββ IStateMachine.cs β βββ GameStateMachine.cs # Manages transitions between game states β βββ GameStates/ β βββ IState.cs # Defines basic states that can run initialization logic, accept a payload on entry, and perform cleanup or transitions on exit β βββ LoadProgressState.cs # A game state responsible for loading or initializing player progress and transitioning to the next state upon completion β βββ MockNextState.cs # Any next state β βββ SaveComponent/ β βββ SaveTrigger.cs # MonoBehavior component for saving player progress when the player enters the collider area on a scene β βββ Services/ β βββ IService.cs # A base marker interface used to identify service classes β βββ PersistentProgress/ β β βββ ISavedProgressReader.cs # An interface for loading player progress data from a given PlayerProgress instance with read-only access β β βββ ISavedProgressWriter.cs # An interface for updating and reading player progress data from a given PlayerProgress instance β β βββ IPersistentProgressService.cs # An interface for providing access to the current player progress for reading and updating across the game β β βββ PersistentProgressService.cs # Provide a reference to the player progress β βββ SaveLoad/ β β βββ ISaveLoadService.cs # Defines basic operations for saving, loading, and resetting player progress β β βββ SaveLoadService.cs # Handles saving, loading, and resetting player progress using PlayerPrefs and synchronizes progress data across game components β β βββ IAsyncSaveLoadService.cs # Defines an interface for asynchronous loading and saving of player progress, and load completion callback βββ βββ βββ YGAsyncSaveLoadService.cs # Provides an asynchronous implementation of player progress saving and loading for the Yandex Games platform, integrating with YG SDK
-
SaveLoadService:
SaveLoadServiceYGAsyncSaveLoadService
-
PersistentProgressService:
- Centralized access to player progress data
-
Factory:
GameFactoryhandles object creation in the game sceneStateFactoryhandles states of the game
-
GameStateMachine:
GameStateMachinemanages game states
-
Data:
PlayerProgressstores user data relevant to gameplay progression.SavesYGextends the Yandex Games Plugin save system to support custom data
-
State Machine:
GameStateMachine
-
Abstract Factory:
GameFactoryStateFactory
-
Dependency Injection:
- Inject dependencies via a constructor (or a special
Construct()method for MonoBehaviour classes)
- Inject dependencies via a constructor (or a special
| Name | Description |
|---|---|
| init | Start a project/task |
| build | Project build or changes in external dependencies |
| sec | Security and vulnerability fixes |
| ci | CI configuration and script updates |
| docs | Documentation updates |
| feat | Adding new functionality |
| fix | Bug fixes |
| perf | Changes aimed at improving performance |
| refactor | Code refactoring without fixing bugs or adding new features |
| revert | Reverting previous commits |
| style | Code style fixes (tabs, indents, dots, commas, etc.) |
| test | Adding tests |
| chore | Changes to the build process or auxiliary tools and libraries |