<aside>
π‘ The Lives System manages the player's lives count, automatic restoration timer, infinite mode, and life locking during gameplay.
</aside>
- LivesSystem β static controller; exposes the full public API for all lives operations.
- LivesData β ScriptableObject configuration; stores max lives count, restoration duration, and reward prefab references.
- LivesStatus β snapshot of the current lives state; delivered via the
StatusChanged event.
- LivesSave β serializable save data; handles persistence and offline restoration time calculation.
- LivesSystemInitModule β registers the system in the Initializer.
Setup
Create a LivesData asset
Create a new LivesData ScriptableObject via Assets β Create β Data β Lives. Configure the following fields:
- Max Lives Count β default number of lives the player starts with and restores up to.
- One Life Restoration Duration β time in seconds to restore one life (default: 1200Β =Β 20Β min).
- Reward section β assign a sprite and three optional reward preview prefabs for
LivesReward, LivesMaxLivesReward, and LivesInfiniteModeReward.

Add to Project Init Settings
Open the Init scene, select the Initializer object, and add LivesSystemInitModule to the modules list. Assign the LivesData asset to the Lives Data field.

UI Components
LivesIndicator
LivesIndicator is a MonoBehaviour that displays the current lives state in the HUD. It subscribes to LivesSystem.StatusChanged and updates automatically.
- Shows a heart count or an infinity icon when infinite mode is active.