private void FixedUpdate() { float xDifference = oscX.SampleDelta(data.refs.ts.DeltaTime()); float yDifference = oscY.SampleDelta(data.refs.ts.DeltaTime()); Vector2 change = new Vector2(xDifference, yDifference); mover.OffsetPosition(change); }
private void FixedUpdate() { if (lerping) { Vector2 stepVelocity = velocity * timeScale.DeltaTime(); if (stepVelocity.sqrMagnitude > (destination - mover.GetPosition()).sqrMagnitude) { mover.TeleportPosition(destination); OnCompleted(); } else { mover.OffsetPosition(stepVelocity); } } }
public void ReceiveInput(InputReader inputReader) { float axisH = inputReader.GetAxisHorizontalRaw(); float axisV = inputReader.GetAxisVerticalRaw(); Vector2 change = new Vector2(axisH, axisV) * data.movementSpeed * tsGameplay.DeltaTime(); mover.OffsetPosition(change); if (!tsGameplay.IsPaused()) { if (inputReader.GetKeyDown(KeyCode.Space)) { playerPunch.Punch(); } } if (inputReader.GetKeyDown(KeyCode.Escape)) { TogglePause(); } }
private void FixedUpdate() { mover.OffsetPosition(velocity * timeScale.DeltaTime()); }
private void FixedUpdate() { mover.OffsetPosition(data.velocity * data.refs.ts.DeltaTime()); }