public sealed struct Sandbox.TimeSince
A convenience struct to easily measure time since an event last happened, based on `Sandbox.Time.Now`. Typical usage would see you assigning 0 to a variable of this type to reset the timer. Then the struct would return time since the last reset. i.e.: TimeSince lastUsed = 0; if ( lastUsed > 10 ) { /*Do something*/ }
Related Guides
Broader workflow and conceptual references connected to this API.
By default, async tasks in s&box run on the main thread. They operate a lot like coroutines, making them the perfect replacement.
You can create links by adding a NavMeshLink Component to an GameObject.
s&box provides a set of utilities for working with time in your game. These let you write things like cooldowns, countdowns, and frame-rate independent movement cleanly and without manual bookkeeping.
Properties
Showing 2 properties
public float Sandbox.TimeSince.Absolute { get; set; }
Time at which the timer reset happened, based on `Sandbox.Time.Now`.
public float Sandbox.TimeSince.Relative { get; set; }
Time passed since last reset, in seconds.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.TimeSince |