At scene start StartLevel is called to start at the very first level in the LevelSet
void StartLevel(int index)
{
_gameOver = false;
_currentLevelIndex = Mathf.Clamp(index, 0, levelSet.levels.Length - 1);
_currentRound = 0;
_levelCorrectCount = 0; // reset per-level correct counter
_attemptsUsed = 0;
_score = 0; // remove this line if you want cumulative score across levels
// reset current level session counters
_sessionLevelScores[_currentLevelIndex] = 0;
_sessionLevelWrongs[_currentLevelIndex] = 0;
UpdateHeader();
BuildStarIndicators();
NextRound();
}
2 of the methods called set the UI stuff to match the levelset.
BuildStarIndicators() supposed to put the stars on the screen which you can see the client's video doesn't have
void BuildStarIndicators()
{
if (!starContainer || !starPrefab) return;
foreach (Transform child in starContainer)
Destroy(child.gameObject);
_starImages.Clear();
var lvl = levelSet.levels[_currentLevelIndex];
for (int i = 0; i < lvl.rounds; i++)
{
var star = Instantiate(starPrefab, starContainer);
star.sprite = emptyStarSprite;
_starImages.Add(star);
}
}
NextRound() destroys any image on screen because before I was on the project had an array of images instead of just one
void NextRound()
{
var lvl = levelSet.levels[_currentLevelIndex];
foreach (var b in _spawned) if (b) Destroy(b.gameObject);
_spawned.Clear();
_currentRound++;
_attemptsUsed = 0;
if (roundText) roundText.text = $"Round: {_currentRound}/{lvl.rounds}";
int px = lvl.GetPixelSize(config.devicePPI);
SpawnShapes(lvl, px);
ResetTimer();
}
SpawnShapes is where the meat is and is the only method I touched. It's what spawns the icon in the center