// Handles updating positions for the player line, along with line starting and finishing events. private void UpdatePlayerLine(bool recordScore) { if (isPaused) { return; } if (inputManager.PrimaryInputDown()) { if (wasDownPreviously) { lastLineEnd = inputManager.PrimaryInputPosWorld(); events.OnLineUpdated?.Invoke(lastLineStart, lastLineEnd); } else { lastLineStart = inputManager.PrimaryInputPosWorld(); lastLineEnd = inputManager.PrimaryInputPosWorld(); events.OnLineCreated?.Invoke(lastLineStart, lastLineEnd); } wasDownPreviously = true; } else { if (wasDownPreviously) { DataEarnedScore points = CollectBubblesAsNecessary(recordScore); events.OnBubblesChange?.Invoke(bubbles); events.OnLineDestroyed?.Invoke(lastLineStart, lastLineEnd, points); wasDownPreviously = false; } } }