WorldSystem class abstract
Work a package adds to a world's frame, one of each type per world:
world.system makes it the first time it's asked for. Its hooks run in
World.update, systems by their order, then in the order they were
made; they run while the world is World.paused too. What a hook
throws goes to World.errors with no object, and the frame goes on; a
system whose hooks throw in turnOffAfter frames in a row is turned
off (isTurnedOff), and that's reported once.
Constructors
- WorldSystem(World world)
-
A system for
world. Make it in the function given toworld.system(world.system(Wind.new), for aWindsystem of the game's or a package's), which adds it; one made any other way is never run.
Properties
- frameTime → Duration
-
How long its hooks took in the last frame, all of them together
(World.profile).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isTurnedOff → bool
-
Whether its hooks threw in turnOffAfter frames in a row: none of
them runs again, but for dispose.
no setter
- name → String
-
What World.profile calls it: its type's name unless overridden.
no setter
- order → int
-
Where its hooks run among the world's systems: a lower order first,
and systems with the same order in the order they were made. Read
once, when it's made. 0 unless overridden. The built-in animators,
then the particles, come first of all (afterUpdate), and the
cameras last (afterLateUpdate).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- world → World
-
The world whose frame it works in.
final
Methods
-
afterFixedUpdate(
) → void - Called at the end of each fixed step, after every GameObject.onFixedUpdate and before the routines waiting for fixedStep: physics steps here.
-
afterFrame(
) → void - Called at the end of each frame, after everything else: physics starts the step it runs between frames here.
-
afterLateUpdate(
) → void - Called every frame after the late updates, before the cameras move.
-
afterUpdate(
) → void - Called every frame after every GameObject.onUpdate, the motions and the routines, before any GameObject.onLateUpdate: where an animator poses what the updates moved, as Unity's does.
-
applicationPause(
bool paused) → void - Called when World.applicationPaused changes, before the objects' GameObject.onApplicationPause: audio stops while the app is away.
-
beforeFixedUpdate(
) → void - Called at the start of each fixed step, before any GameObject.onFixedUpdate.
-
beforeFrame(
) → void - Called at the start of each frame, after the time moves on and before the input and the starts: physics collects the step it ran between frames here.
-
beforeUpdate(
) → void - Called every frame after the fixed steps, before any GameObject.onUpdate: physics puts interpolated bodies here.
-
componentAdded(
GameObject object, Component component) → void -
Called when
componentcomes into the world onobject: put on it while it's in the world, or with it when it's added (each of an added tree's components, parents first). After the engine has it, before a behaviour loads. Not for a model's parts, read from the model. -
componentRemoved(
GameObject object, Component component) → void -
Called when
componentleaves the world, for each componentAdded had: it's removed fromobject, orobjectis destroyed (then GameObject.isDestroyed is true, and it's called for each of its components, after everyonDestroy). The component is Component.isRemoved by then. -
dispose(
) → void - Called once when the world is disposed: free what the system holds.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pointerHit(
Ray ray, LayerMask layers) → RayHit? -
What
ray, cast from the camera through a finger, hits of what the system holds withinlayers, or null: the input takes the nearest of the world's World.raycast and every system's, so a package can make what has no mesh tappable (physics: its colliders). -
toString(
) → String -
A string representation of this object.
inherited
-
viewStarted(
) → void -
Called once, when the world is first shown on screen (by a
FynkelView; a HeadlessView doesn't count): audio opens the sound output here, so a test makes no sound. A system made after that isn't called; WorldSystems.isOnScreen says so.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- turnOffAfter → const int
- After how many frames in a row with a hook throwing a system is turned off.