Skip to content

Commit 6d5c59f

Browse files
fix
Adding back the original constructor for BufferedItem.
1 parent e8a5d74 commit 6d5c59f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs

+14-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected internal struct BufferedItem
101101
public double TimeSent;
102102

103103
/// <summary>
104-
/// The constructor.
104+
/// Constructor that accepts an item identifier.
105105
/// </summary>
106106
/// <param name="item">The item value.</param>
107107
/// <param name="timeSent">The time the item was sent.</param>
@@ -112,6 +112,19 @@ public BufferedItem(T item, double timeSent, int itemId)
112112
TimeSent = timeSent;
113113
ItemId = itemId;
114114
}
115+
116+
/// <summary>
117+
/// The original constructor.
118+
/// </summary>
119+
/// <param name="item">The item value.</param>
120+
/// <param name="timeSent">The time the item was sent.</param>
121+
public BufferedItem(T item, double timeSent)
122+
{
123+
Item = item;
124+
TimeSent = timeSent;
125+
// Generate a unique item id based on the time to the 2nd decimal place
126+
ItemId = (int)(timeSent * 100);
127+
}
115128
}
116129

117130
/// <summary>

0 commit comments

Comments
 (0)