public void NextLevel(float points) { ResetBonus(); LevelDataToSave data = LevelSelectedData; data.avgTimeRespond /= data.amountWords; data.points = points; coins += Mathf.RoundToInt(20 * (1 - ((data.maxPoints - points >= 0 ? data.maxPoints - points + data.minPoints : 0) / data.maxPoints))); saveLoad.AddData(Challenge_Type, data); float avg = (data.maxPoints - data.minPoints) / 2; if (data.level == ModeSelected.maxLevel && data.points > data.minPoints + avg) { ModeSelected.maxLevel++; ModeSelected.CurrentLevel++; if (data.points > data.minPoints + avg) { LevelSelectedData.difficulty = LevelSelectedData.difficulty + 1; } else if (data.points > data.minPoints) { LevelSelectedData.difficulty = LevelSelectedData.difficulty + 0.5f; } data = LevelSelectedData; SetPoints(ref data, challengeType); } }
public void NextLevel(float points) { LevelDataToSave data = infoType[Challenge_Type].CurrentLevelData; data.points = points; saveLoad.AddData(Challenge_Type, data); float avg = (data.maxPoints - data.minPoints) / 2; if (data.points > data.minPoints + avg) { infoType[challengeType].Difficulty = infoType[challengeType].Difficulty + 10; } else if (data.points > data.minPoints) { infoType[challengeType].Difficulty = infoType[challengeType].Difficulty + 9.5f; } infoType[challengeType].CurrentLevel++; data = infoType[Challenge_Type].CurrentLevelData; SetPoints(ref data); }