docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MarsTime

    Provides access to frame-rate independent time information for the MARS lifecycle

    Inheritance
    object
    MarsTime
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.MARS.Simulation
    Assembly: Unity.MARS.Interfaces.dll
    Syntax
    [MovedFrom("Unity.MARS")]
    public static class MarsTime

    Properties

    FrameCount

    The total number of MarsUpdates that have occurred

    Declaration
    public static int FrameCount { get; }
    Property Value
    Type Description
    int

    Paused

    Whether MarsUpdates are paused

    Declaration
    public static bool Paused { get; }
    Property Value
    Type Description
    bool

    ScaledDeltaTime

    Unity deltaTime scaled by TimeScale

    Declaration
    public static float ScaledDeltaTime { get; }
    Property Value
    Type Description
    float

    Time

    The time the latest MarsUpdate has started. This is the time in seconds since the start of the MARS lifecycle. This scales with TimeScale.

    Declaration
    public static float Time { get; }
    Property Value
    Type Description
    float

    TimeScale

    The scale at which Time passes. This is 1 at the start of the MARS lifecycle. When TimeScale is 1, MARS Time passes at the same rate as Unity time. When TimeScale is 0, MarsUpdates are paused. A higher TimeScale value corresponds to a higher frequency of MarsUpdates per frame. Setting this value does not affect updates until the next frame.

    Declaration
    public static float TimeScale { get; set; }
    Property Value
    Type Description
    float

    TimeStep

    The fixed interval in seconds at which MarsUpdates are performed. This is not affected by TimeScale.

    Declaration
    public static float TimeStep { get; }
    Property Value
    Type Description
    float

    Methods

    Pause()

    Sets TimeScale to 0 and stops MarsUpdates from running for the rest of the frame and until TimeScale is set to a positive value

    Declaration
    public static void Pause()

    Play()

    If Paused is true, sets TimeScale to 1 and starts MarsUpdates running. Does nothing if Paused is false.

    Declaration
    public static void Play()

    Events

    MarsUpdate

    Called every TimeStep seconds while the MARS lifecycle is running. The frequency of MARS updates per player loop update scales with TimeScale.

    Declaration
    public static event Action MarsUpdate
    Event Type
    Type Description
    Action
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)