public GameplayParams(GameplayParams p0, GameplayParams p1, float t) { spawnMinGap = Mathf.Lerp(p0.spawnMinGap, p1.spawnMinGap, t); spawnSecondaryGap = Mathf.Lerp(p0.spawnSecondaryGap, p1.spawnSecondaryGap, t); spawnMaxGap = Mathf.Lerp(p0.spawnMaxGap, p1.spawnMaxGap, t); spawnPUEvry = Mathf.Lerp(p0.spawnPUEvry, p1.spawnPUEvry, t); delayPerUnitOfDistance = Mathf.Lerp(p0.delayPerUnitOfDistance, p1.delayPerUnitOfDistance, t); amplifyBonusPercent = Mathf.Lerp(p0.amplifyBonusPercent, p1.amplifyBonusPercent, t); }
void Update() { if (state == GameState.InGame) { float t = Mathf.InverseLerp(0, endGameTime, Player.instance.duration); _currentParams = new GameplayParams(startParams, endParams, t); } handleInput(); updateWarnings(); }
void reset() { if (_isPaused) { pause(); } _currentParams = startParams; Player.instance.Reset(); Track.inst.reset(); if (_playLoopCo != null) { StopCoroutine(_playLoopCo); AudioManager.inst.stopSound(_music); _music = null; } }