logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityGameRailService

    Unity MonoBehaviour implementation of IGameRailService.

    Inheritance
    object
    UnityGameRailService
    Implements
    IGameRailService
    IService
    IFoundationSettings
    Namespace: Serenity.GameRail.Infrastructure.Services
    Assembly: Serenity.UnityGameRail.Infrastructure.dll
    Syntax
    public class UnityGameRailService : MonoBehaviour, IGameRailService, IService, IFoundationSettings
    Remarks

    Maintains registered rail paths and their current progress. Progress is driven externally; this service is intentionally passive.

    Constructors

    UnityGameRailService()

    Declaration
    public UnityGameRailService()

    Properties

    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

    Methods

    AdvanceProgress(RailId, float)

    Declaration
    public void AdvanceProgress(RailId id, float delta)
    Parameters
    Type Name Description
    RailId id
    float delta

    ConfigureRail(RailPathConfig)

    Declaration
    public void ConfigureRail(RailPathConfig config)
    Parameters
    Type Name Description
    RailPathConfig config

    GetPath(RailId)

    Returns the registered RailPath for the given id, or null if not found.

    Declaration
    public RailPath GetPath(RailId id)
    Parameters
    Type Name Description
    RailId id
    Returns
    Type Description
    RailPath

    GetProgress(RailId)

    Declaration
    public RailProgress GetProgress(RailId id)
    Parameters
    Type Name Description
    RailId id
    Returns
    Type Description
    RailProgress

    GetSnapshot(RailId)

    Declaration
    public RailSnapshot GetSnapshot(RailId id)
    Parameters
    Type Name Description
    RailId id
    Returns
    Type Description
    RailSnapshot

    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.

    RegisterRail(RailId, RailNodePosition[])

    Declaration
    public void RegisterRail(RailId id, RailNodePosition[] nodes)
    Parameters
    Type Name Description
    RailId id
    RailNodePosition[] nodes

    ResetProgress(RailId)

    Declaration
    public void ResetProgress(RailId id)
    Parameters
    Type Name Description
    RailId id

    SetProgress(RailId, RailProgress)

    Declaration
    public void SetProgress(RailId id, RailProgress progress)
    Parameters
    Type Name Description
    RailId id
    RailProgress progress

    Implements

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