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
    IRailPathProvider
    Namespace: Serenity.GameRail.Infrastructure.Services
    Assembly: Serenity.UnityGameRail.Infrastructure.dll
    Syntax
    public class UnityGameRailService : MonoBehaviour, IGameRailService, IService, IFoundationSettings, IRailPathProvider
    Remarks

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

    Constructors

    UnityGameRailService()

    Declaration
    public UnityGameRailService()

    Fields

    LOG_CATEGORY

    Declaration
    protected const string LOG_CATEGORY = "GameRailService"
    Field Value
    Type Description
    string

    _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

    _paths

    Declaration
    protected readonly Dictionary<RailId, RailPath> _paths
    Field Value
    Type Description
    Dictionary<RailId, RailPath>

    _progress

    Declaration
    protected readonly Dictionary<RailId, RailProgress> _progress
    Field Value
    Type Description
    Dictionary<RailId, RailProgress>

    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 virtual void AdvanceProgress(RailId id, float delta)
    Parameters
    Type Name Description
    RailId id
    float delta

    AdvanceProgress(RailId, float, RailAdvanceMode)

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

    ConfigureRail(RailPathConfig)

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

    GetPath(RailId)

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

    GetProgress(RailId)

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

    GetSnapshot(RailId)

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

    InitializeService(ILogService)

    Initializes the service with required dependencies.

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

    The logging service for diagnostic output.

    RegisterRail(RailId, RailNodePosition[])

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

    ResetProgress(RailId)

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

    SetProgress(RailId, RailProgress)

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

    Implements

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