public bool FitnessCheck(competenceLevel competence) { float d = platformSpawner.totalGapWidth + wallSpawner.totalBrickHeight - enemySpawner.spawnNoise; // tried with math varoations of these. Looks like simple works best. //Debug.Log ("difficulty" + d); //Debug.Log ("competence level" + competence); switch (competence) { case competenceLevel.LOW: if (d < lowDifficulty) { return(true); } break; case competenceLevel.MEDIUM: if (d > lowDifficulty && d <= mediumDifficulty) // TO DO : make these magic values a function of comptence { return(true); } break; case competenceLevel.HIGH: if (d > mediumDifficulty) { return(true); } break; } return(false); }
private void UpdateCompetenceLevel() { if (slider.value <= 0.25) { competence = competenceLevel.LOW; } else if (slider.value <= 0.65) { competence = competenceLevel.MEDIUM; } else { competence = competenceLevel.HIGH; } }