Table of Contents

Enum UnityOrder

Namespace
Valheim.Testing.Doubles
Assembly
Valheim.Testing.Doubles.dll

Where Unity promises no order, which order the doubles use (WithUnityOrder(UnityOrder)): Awake, OnEnable and OnDisable across the objects of a hierarchy that is activated, deactivated or instantiated; each phase of Object.RunFrame (Start, Update, coroutines and Invoke, LateUpdate, end-of-frame coroutines) across behaviours; OnDestroy across the objects EndOfFrame destroys and within a destroyed hierarchy; and FindObjectsByType with FindObjectsSortMode.None (so FindAnyObjectByType). What Unity does promise is kept in both: one behaviour's own sequence (Awake, OnEnable, Start, Update, ...), a behaviour waking at once in AddComponent on an active object, every behaviour finishing a frame phase before the next phase, and FindObjectsSortMode.InstanceID. Unity's script execution order (DefaultExecutionOrder, the project settings) is not modelled.

public enum UnityOrder

Fields

Insertion = 0

The default: the order objects and components were made or queued in. Deterministic, which Unity is not.

Reversed = 1

The exact reverse of Insertion. Any two objects meet in the other order, so a test that passes in both does not depend on which of two objects goes first; it says nothing about orders of three or more.