Skip to content

Commit

Permalink
Predicted Billiards Example: remove old 'inputs' code
Browse files Browse the repository at this point in the history
  • Loading branch information
mischa committed Apr 2, 2024
1 parent 83d652c commit 779da04
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ public class PlayerPredicted : NetworkBehaviour
// white ball component
WhiteBallPredicted whiteBall;

// keep a history of inputs with timestamp
public int inputHistorySize = 64;
readonly SortedList<double, PlayerInput> inputs = new SortedList<double, PlayerInput>();

void Awake()
{
// find the white ball once
Expand Down Expand Up @@ -62,11 +58,6 @@ void ApplyForceToWhite(Vector3 force)
// we reuse the white ball's OnMouseDrag and forward the event to here.
public void OnDraggedBall(Vector3 force)
{
// record the input for reconciliation if needed
if (inputs.Count >= inputHistorySize) inputs.RemoveAt(0);
inputs.Add(NetworkTime.time, new PlayerInput(NetworkTime.time, force));
Debug.Log($"Inputs.Count={inputs.Count}");

// apply force locally immediately
ApplyForceToWhite(force);

Expand Down

0 comments on commit 779da04

Please sign in to comment.