Docs: reduce over-documentation across gameplay scripts
Trim restated narration, dead commented-out code, and oversized class headers; keep all why-comments (authority, timing, edge cases), tooltips, and serialization caveats. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
882d30797e
commit
066e308cde
21 files changed
+478
-902
No files matched your search
@@ -8,21 +8,17 @@ public partial class MeshPainter
|
||||
{
|
||||
// --- Undo / redo: per-stroke history of the canonical maps, mirrored on every peer ---
|
||||
//
|
||||
// One stroke (mouse-down -> mouse-up) = one undo step. Each entry is the full canonical map set AFTER
|
||||
// that edit, restored by re-seeding the backend (same path as load / late-join snapshot). The baseline
|
||||
// at index 0 is the material seed (or a loaded / snapshotted baseline).
|
||||
// One stroke (mouse-down -> mouse-up) = one undo step; each entry is the full canonical map set AFTER
|
||||
// that edit, restored by re-seeding the backend. Index 0 is the baseline (material seed, or a
|
||||
// loaded/snapshotted one).
|
||||
//
|
||||
// Networked design: every replica keeps the SAME history, so undo/redo replicates as a tiny command
|
||||
// instead of re-broadcasting the whole painting. The owner assigns each committed stroke a monotonic
|
||||
// CHECKPOINT ID; remotes replay the same stamps and capture history at the same boundaries (driven by a
|
||||
// network checkpoint marker) under the owner's id. Undo/redo carries the TARGET id; a peer that holds
|
||||
// that id restores locally, a peer that doesn't (a late joiner asked to undo past its join) falls back
|
||||
// to a snapshot. PlayerPaintSync drives all of this through OnHistoryCheckpoint / OnHistoryRestore.
|
||||
// Networked: every replica keeps the SAME history, so undo/redo replicates as a tiny command. The
|
||||
// owner tags each committed stroke with a monotonic CHECKPOINT ID; remotes capture history at the same
|
||||
// boundaries under that id. Undo/redo carries the TARGET id; a peer lacking it (a late joiner) falls
|
||||
// back to a snapshot. PlayerPaintSync drives this via OnHistoryCheckpoint / OnHistoryRestore.
|
||||
//
|
||||
// Memory: consecutive states differ only in the maps a stroke actually painted, so unchanged maps are
|
||||
// shared by reference with the previous entry (copy-on-write). This is safe because both backends
|
||||
// CLONE their seed input (SeedCpuPixels / SeedGpuMap) and ReadCanonical returns fresh arrays - nothing
|
||||
// ever writes back into a stored state array.
|
||||
// Memory: unchanged maps are shared by reference with the previous entry (copy-on-write) - safe
|
||||
// because both backends CLONE their seed input and ReadCanonical returns fresh arrays.
|
||||
|
||||
[Header("Undo")]
|
||||
[Tooltip("Maximum number of undoable edits kept in memory (strokes + loads). Older edits drop off; " +
|
||||
|
||||
Reference in new issue
Block a user