Diagnostic code · ARA0100
Mutable static state
A gameplay module stores mutable state in a static field or auto-property. Statics are outside ECS save, replay and replication, and their lifetime does not follow gameplay state. The edit is rejected; the last good code keeps running.
Common causes
- A non-constant static field is not
readonly. - A static auto-property has a setter.
Fixes
Move authoritative shared state into a
[Resource]struct, or per-entity state into a[Component]struct.Use
constorstatic readonlyonly for genuinely immutable data; a readonly reference to mutable gameplay data does not make that state safe.Code:
ARA0100Constant:
cs::MUTABLE_STATICReported by: Ara.Analyzers