logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnitySystemConfigurationService

    Main orchestrator service that manages system configuration collection and monitoring.
    Determines WHEN to collect system information (startup, focus changes, resolution changes, polling) and delegates the WHAT to providers and WHERE to stores.
    Implements multiple interfaces to maintain compatibility while providing comprehensive system configuration management.
    Manages automatic collection on Unity lifecycle events and periodic polling based on configuration settings.

    Inheritance
    object
    UnitySystemConfigurationService
    Implements
    ISystemConfigurationService
    ISystemConfigurationProvider
    ISystemConfigurationSnapshotStore
    IService
    IFoundationSettings
    Namespace: Serenity.SystemConfiguration.Infrastructure.Services
    Assembly: Serenity.UnitySystemConfiguration.Infrastructure.dll
    Syntax
    public class UnitySystemConfigurationService : MonoBehaviour, ISystemConfigurationService, ISystemConfigurationProvider, ISystemConfigurationSnapshotStore, IService, IFoundationSettings

    Constructors

    UnitySystemConfigurationService()

    Declaration
    public UnitySystemConfigurationService()

    Fields

    _gameSettings

    Declaration
    protected IGameSettingsService _gameSettings
    Field Value
    Type Description
    IGameSettingsService

    _guid

    Declaration
    protected string _guid
    Field Value
    Type Description
    string

    _id

    Declaration
    protected string _id
    Field Value
    Type Description
    string

    _logService

    Declaration
    protected ILogService _logService
    Field Value
    Type Description
    ILogService

    _pollCoroutine

    Declaration
    protected Coroutine _pollCoroutine
    Field Value
    Type Description
    Coroutine

    _provider

    Declaration
    protected ISystemConfigurationProvider _provider
    Field Value
    Type Description
    ISystemConfigurationProvider

    _settingsSO

    Declaration
    protected UnitySystemConfigurationSettings _settingsSO
    Field Value
    Type Description
    UnitySystemConfigurationSettings

    _typedSettings

    Declaration
    protected ISystemConfigurationSettings _typedSettings
    Field Value
    Type Description
    ISystemConfigurationSettings

    _wasFocused

    Declaration
    protected bool _wasFocused
    Field Value
    Type Description
    bool

    Properties

    CurrentSnapshot

    Gets the current system configuration snapshot from the internal store.
    Returns null if no snapshot has been collected yet or if the store is not initialized.

    Declaration
    public ISystemConfigurationSnapshot CurrentSnapshot { get; }
    Property Value
    Type Description
    ISystemConfigurationSnapshot

    Current system configuration snapshot or null

    Guid

    Unique GUID for the settings instance.

    Declaration
    public string Guid { get; set; }
    Property Value
    Type Description
    string

    Id

    Unique identifier for the settings instance.

    Declaration
    public string Id { get; set; }
    Property Value
    Type Description
    string

    LogService

    Log service used for diagnostic output and error reporting.

    Declaration
    public ILogService LogService { get; set; }
    Property Value
    Type Description
    ILogService

    Methods

    GetSnapshot()

    Gets a new system configuration snapshot by delegating to the internal provider.
    Returns comprehensive system information including culture, hardware, and display data with privacy protection applied.

    Declaration
    public virtual ISystemConfigurationSnapshot GetSnapshot()
    Returns
    Type Description
    ISystemConfigurationSnapshot

    Complete system configuration snapshot with configured privacy protections

    InitializeGameSettings(IGameSettingsService)

    Optional injection method for game settings service integration.
    Enables automatic synchronization of system configuration data with game settings when snapshots are collected.
    Can be called after service initialization to add game settings synchronization functionality.

    Declaration
    public void InitializeGameSettings(IGameSettingsService gameSettingsService)
    Parameters
    Type Name Description
    IGameSettingsService gameSettingsService

    Game settings service for automatic synchronization

    InitializeService(ISystemConfigurationSettings, ILogService)

    Initializes the system configuration service with settings and logging dependencies.
    Creates and configures internal providers, stores, and detectors based on the provided settings.
    Applies platform guards to disable the service on unsupported platforms.
    Automatically triggers startup collection and begins polling if configured to do so.

    Declaration
    public virtual void InitializeService(ISystemConfigurationSettings settings, ILogService logService)
    Parameters
    Type Name Description
    ISystemConfigurationSettings settings

    System configuration settings controlling service behavior

    ILogService logService

    Logging service for diagnostic output and error reporting

    SetAsync(ISystemConfigurationSnapshot, CancellationToken)

    Stores a system configuration snapshot asynchronously by delegating to the internal store.
    Handles persistence, game settings synchronization, and logging as configured in the service settings.

    Declaration
    public virtual Task SetAsync(ISystemConfigurationSnapshot snapshot, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    ISystemConfigurationSnapshot snapshot

    System configuration snapshot to store

    CancellationToken cancellationToken

    Cancellation token for async operation control

    Returns
    Type Description
    Task

    Task representing the async storage operation

    Implements

    ISystemConfigurationService
    ISystemConfigurationProvider
    ISystemConfigurationSnapshotStore
    IService
    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved