Time class final
The world's clock, as Unity's Time: read it from any object or
behaviour as time (time.delta). World.update moves it on once a
frame, before anything runs.
The game's time is also cut into fixed steps of fixedDelta (50 a second by default), whatever the frame rate: each frame runs as many as its time holds, maybe none (GameObject.onFixedUpdate). Inside one, delta is fixedDelta and sinceStart the steps' own time.
Properties
- delta → double
-
The seconds this frame counts for: the frame's time times scale,
at most maxDelta (as Unity's). Move by
speed * time.delta. Inside a fixed step, fixedDelta.no setter - fixedAlpha → double
-
How far this frame is from the last fixed step towards the next, 0 to
1: to draw what the steps move between where the last two left it.
no setter
- fixedDelta ↔ double
-
How long a fixed step is, in game seconds: 1/50 by default, as
Unity's. Throws an ArgumentError unless it's finite and more than 0.
getter/setter pair
- frame → int
-
How many frames have run: 0 before the first World.update.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- inFixedStep → bool
-
Whether a fixed step is running: in GameObject.onFixedUpdate, and
in what runs with it.
no setter
- maxDelta ↔ double
-
The most one frame counts for, in seconds of game time (1/3 by
default, as Unity's): after a hitch (loading, the app in the
background) the game steps this far rather than jumping, whatever
its scale. Throws an ArgumentError unless
it's more than 0.
getter/setter pair
- maxFixedSteps ↔ int
-
The most fixed steps one frame runs (5 by default): past that, the
rest of the frame's time is dropped, so a frame slower than its
steps can't make the next one slower still. Raise it for a game that
runs scale fast at a low frame rate. Throws an ArgumentError
unless it's 1 or more.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale ↔ double
-
How fast the game's time runs: 1 is real time, 0.5 slow motion, 0
stopped (objects still get their updates, with a delta of 0). To
pause the game, input and all, use World.paused.
Throws an ArgumentError unless it's finite and 0 or more.
getter/setter pair
- sinceStart → double
-
The sum of every frame's delta: the game's time since the world
was made. Inside a fixed step, the time at its end: fixedDelta times
the steps so far.
no setter
- unscaledDelta → double
-
This frame's seconds without scale (still at most maxDelta): for
what keeps moving while the game is paused, such as a pause menu.
no setter
- unscaledSinceStart → double
-
The sum of every frame's unscaledDelta.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited