docs.unity3d.com
    显示 / 隐藏目录

    Class MarsTime

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

    Inheritance
    Object
    MarsTime
    Namespace: Unity.MARS
    Syntax
    public static class MarsTime

    Properties

    FrameCount

    The total number of MarsUpdates that have occurred

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

    Paused

    Whether MarsUpdates are paused

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

    ScaledDeltaTime

    Unity deltaTime scaled by TimeScale

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

    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
    Single

    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
    Single

    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
    Single

    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
    返回到顶部
    Copyright © 2023 Unity Technologies — 商标和使用条款
    • 法律条款
    • 隐私政策
    • Cookie
    • 不要出售或分享我的个人信息
    • Your Privacy Choices (Cookie Settings)