logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityGameSessionService

    Unity MonoBehaviour implementation of IGameSessionService.

    Inheritance
    object
    UnityGameSessionService
    Implements
    IGameSessionService
    IService
    IFoundationSettings
    Namespace: Serenity.GameSession.Infrastructure.Services
    Assembly: Serenity.UnityGameSession.Infrastructure.dll
    Syntax
    public class UnityGameSessionService : MonoBehaviour, IGameSessionService, IService, IFoundationSettings
    Remarks

    Delegates session state management to GameSessionState and reads elapsed time from an injected ITimer.

    Constructors

    UnityGameSessionService()

    Declaration
    public UnityGameSessionService()

    Properties

    ElapsedTime

    Declaration
    public float ElapsedTime { get; }
    Property Value
    Type Description
    float

    Guid

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

    Id

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

    LogService

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

    SessionId

    Declaration
    public GameSessionId SessionId { get; }
    Property Value
    Type Description
    GameSessionId

    Status

    Declaration
    public GameSessionStatus Status { get; }
    Property Value
    Type Description
    GameSessionStatus

    Methods

    Complete()

    Declaration
    public void Complete()

    ConfigureTimer(ITimer)

    Declaration
    public void ConfigureTimer(ITimer timer)
    Parameters
    Type Name Description
    ITimer timer

    GameOver()

    Declaration
    public void GameOver()

    GetSnapshot()

    Declaration
    public GameSessionSnapshot GetSnapshot()
    Returns
    Type Description
    GameSessionSnapshot

    InitializeService(ILogService)

    Initializes the service with required dependencies.

    Declaration
    public void InitializeService(ILogService logService)
    Parameters
    Type Name Description
    ILogService logService

    The logging service for diagnostic output.

    Pause()

    Declaration
    public void Pause()

    Resume()

    Declaration
    public void Resume()

    StartSession(GameSessionId)

    Declaration
    public void StartSession(GameSessionId sessionId)
    Parameters
    Type Name Description
    GameSessionId sessionId

    Tick()

    Declaration
    public void Tick()

    Implements

    IGameSessionService
    IService
    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved