private void SprintInput() { if (GameInputManager.getKeyDown(GameInputManager.InputType.Sprint) && isSprinting != true) { isSprinting = true; } if (GameInputManager.getKeyUp(GameInputManager.InputType.Sprint) && isSprinting == true) { isSprinting = false; } }
// Update is called once per frame void Update() { if (isPaused) { return; } // only if it's not paused gameTimer += Time.deltaTime; float timeToReduce = Time.deltaTime; bool done = false; bool changed = false; if (GameInputManager.getKeyDown(GameInputManager.InputType.AccelerateTime)) { isAccelerated = true; } if (GameInputManager.getKeyUp(GameInputManager.InputType.AccelerateTime)) { isAccelerated = false; } if (isAccelerated) { timeToReduce *= timeAcceleration; } while (!done && currentQueue.Count != 0) { TimedColor topCol = currentQueue[ActiveColorIndex]; if (topCol.remainingTime - timeToReduce > Mathf.Epsilon) { topCol.remainingTime -= timeToReduce; currentQueue[ActiveColorIndex] = topCol; done = true; } else { float removedTime = topCol.remainingTime; currentQueue.RemoveAt(ActiveColorIndex); changed = true; timeToReduce -= removedTime; } } if (changed) { updatecol(); } }