void Start() { spawnTime = initSpawnTime; Random.InitState(System.DateTime.Now.Millisecond); correctBall = (CorrectBall)Random.Range(0, System.Enum.GetValues(typeof(CorrectBall)).Length); lastCorrectBall = correctBall; SpawnBalls(); }
void checkCorrectBall() { if (correctBallCount % ballsToIncreaseDifficulty == 0 && correctBallCount != 0) { if (correctBallCount != lastCheckPoint) { OnStreak(); Random.InitState(System.DateTime.Now.Millisecond); lastCorrectBall = correctBall; correctBall = (CorrectBall)Random.Range(0, System.Enum.GetValues(typeof(CorrectBall)).Length); while (correctBall == lastCorrectBall) { correctBall = (CorrectBall)Random.Range(0, System.Enum.GetValues(typeof(CorrectBall)).Length); } } lastCheckPoint = correctBallCount; } }