void ChangeDifficulty() { float difficultyMultiplier = Mathf.Clamp(DifficultyCounter / difficultyInfo.timeToMaxDifficulty, 0.0f, 1.0f); float time = Mathf.Lerp(difficultyInfo.maxTimeBetweenSpawns, difficultyInfo.minTimeBetweenSpawns, difficultyMultiplier); float size = Mathf.Lerp(difficultyInfo.maxSize, difficultyInfo.minSize, difficultyMultiplier); float mass = Mathf.Lerp(difficultyInfo.minMass, difficultyInfo.maxMass, difficultyMultiplier); float drag = Mathf.Lerp(difficultyInfo.maxDrag, difficultyInfo.minDrag, difficultyMultiplier); spawner.ApplyDifficulty(time, size, mass, drag); }