Fast Iteration Mode
Fast Iteration Mode lets you skip GONet's code generation step when entering Play mode, dramatically reducing the edit-play-test cycle during development. Toggle it on when you need speed, off when you need to detect prefab changes.
What It Does
Normally, every time you enter Play mode in Unity, GONet runs its code generation pipeline (the SNAP pipeline) to scan for changes to GONetParticipant prefabs and regenerate companion classes. This ensures that any new or modified synced fields are properly handled, but it adds time to every Play mode entry.
Fast Iteration Mode skips the code generation step entirely. GONet uses the last-generated companion classes, allowing near-instant Play mode entry. This is ideal when you are iterating on gameplay logic, testing, or debugging -- situations where the networked prefab configuration has not changed.
How to Enable
Fast Iteration Mode is controlled via the GONet Editor Support window in Unity (accessible from the GONet menu):
// In the GONet Editor Support window:
// Fast Iteration Mode: ✓ Enabled
//
// Access via: Unity menu → GONet → Editor SupportWhen enabled, you will see a log message in the Console confirming that code generation was skipped on Play mode entry.
Trade-offs
When to enable
- •Iterating on gameplay logic (not networking config)
- •Testing and debugging existing networked features
- •Working on non-networked systems (UI, audio, etc.)
- •Any time you want faster Play mode entry
When to disable
- •Added or removed [GONetAutoMagicalSync] attributes
- •Changed GONetParticipant prefab configuration
- •Added new networked prefabs to the project
- •Before shipping or doing a final build
Important: If you add or change synced fields while Fast Iteration Mode is on, the changes will not take effect until you disable it and re-enter Play mode (or do a build). GONet will regenerate the companion classes at that point.
Integration with Code Generation
GONet's code generation pipeline (the SNAP pipeline) is responsible for:
- •Scanning prefabs -- Detecting all GONetParticipant prefabs and their synced fields.
- •Generating companion classes -- Creating serialization, deserialization, and blending code for each synced field.
- •Velocity-augmented sync -- Generating the velocity tracking and extrapolation code for eligible fields.
- •Dirty-flag tracking -- Generating per-field change detection to minimize bandwidth.
Fast Iteration Mode skips all of these steps and reuses the previously generated output. The generated files remain in your project and are not deleted when the mode is toggled.
Best Practices
- •Keep Fast Iteration Mode on as your default during development. Only turn it off when you have changed networked prefab configuration.
- •Always turn it off and do a full generation pass before making a build or committing to version control.
- •If you experience unexpected sync behavior, the first troubleshooting step should be to disable Fast Iteration Mode and re-enter Play mode to ensure companion classes are up to date.
Next Steps
- →Performance -- Best practices for bandwidth, CPU, and memory optimization.
- →Auto-Magical Sync -- Configure synced fields that the code generation pipeline processes.
- →API Reference -- Full reference for GONetGlobal configuration options.