Skip to content

Commit e7cb072

Browse files
committed
Improve docs for BufferData.actualValue and FieldData.oldValue
1 parent c3e0baf commit e7cb072

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Source/Client/Syncing/SyncFieldUtil.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ public readonly struct FieldData
181181
{
182182
public readonly SyncField handler;
183183
public readonly object target;
184+
/// Reflects the value the field had before the most recent GUI update.
185+
/// For unbuffered fields, this is also the current simulation value.
186+
/// For buffered fields, which may modify the field across multiple `Watch` calls,
187+
/// this represents the value at the start of the latest `Watch` invocation.
184188
public readonly object oldValue;
185189
public readonly object index;
186190

@@ -218,6 +222,9 @@ public override int GetHashCode()
218222
public class BufferData
219223
{
220224
public SyncField field;
225+
/// This is the real field's value. If this were an unbuffered field, it'd be equivalent to `FieldData.oldValue`,
226+
/// however for buffered fields `oldValue` reflects the value prior to the last GUI update. Use this field to
227+
/// access the original value before any user interaction occurred.
221228
public object actualValue;
222229
public object toSend;
223230
public long timestamp;

0 commit comments

Comments
 (0)