Method ThrowIfNotInRegistrationPhase
ThrowIfNotInRegistrationPhase(in FixedString512Bytes)
We have no idea how many code-generated types are left to be registered, so instead,
we have a flag that is set when we know ALL of them have been created.
If the user queries this collection BEFORE all queries have been created, then they used to get silent errors where GhostFields default to DontSerializeVariant
.
This throw highlights that user-error.
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
public void ThrowIfNotInRegistrationPhase(in FixedString512Bytes context)
Parameters
Type | Name | Description |
---|---|---|
FixedString512Bytes | context | The context of this call, to aid in error reporting. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Throws if user-code queries too early. |