Skip to content

Commit

Permalink
Move default variables to Create()
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Nov 22, 2024
1 parent afb4a37 commit 1f15069
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace Fika.Core.Coop.ObservedClasses.Snapshotting
{
public class FikaSnapshotter : MonoBehaviour
{
private readonly SortedList<double, PlayerStatePacket> buffer = [];
private SortedList<double, PlayerStatePacket> buffer;
private double localTimeline;
private double localTimeScale = Time.timeScale;
private double localTimeScale;
private SnapshotInterpolationSettings interpolationSettings;
private ExponentialMovingAverage driftEma;
private ExponentialMovingAverage deliveryTimeEma;
Expand All @@ -22,6 +22,8 @@ public class FikaSnapshotter : MonoBehaviour
public static FikaSnapshotter Create(ObservedCoopPlayer player)
{
FikaSnapshotter snapshotter = player.gameObject.AddComponent<FikaSnapshotter>();
snapshotter.buffer = [];
snapshotter.localTimeScale = Time.timeScale;
snapshotter.player = player;
return snapshotter;
}
Expand Down

0 comments on commit 1f15069

Please sign in to comment.