public void IncreaseCurrentCount() { currentCount++; ChangeNoodleProgressText(); if (currentCount == expectedCount) { if (bowlCards.Length == 0) { WinPreparation(); return; } SelectNextCard(); ChangeBowl(); int prev = currentCard - 1; if ((currentCard - 1) == -1) { if (bowlCards.Length > 0) { prev = bowlCards.Length - 1; } else { prev = 0; } } BowlCards doneBowlCard = bowlCards[prev].GetComponent <BowlCards>(); doneBowlCard.Done(); PasteAndPlayClip(doneBowl); ChangeDelayAndChance(doneBowlCard.type); spawner.IncreaseSpawnpointsValue(); cardsDone++; cm.speed++; } }
public void ChangeBowl() { if (cardsDone == bowlCards.Length) { return; } BowlCards bowlCardComponent = GetCurrentCard(); while (bowlCardComponent.done) { SelectNextCard(); bowlCardComponent = bowlCards[currentCard].GetComponent <BowlCards>(); } bowlCardComponent.SwapBowl(); changeBowlEffectIcons.Play(); changeBowlEffectSmoke.Play(); PasteAndPlayClip(changeBowlSound); if (bowlCards.Length > 1) { SelectNextCard(); } }
private void CalculateProgressResult() { int totalProgressCount = 0; foreach (GameObject bowlcard in bowlCards) { BowlCards bc = bowlcard.GetComponent <BowlCards>(); totalProgressCount += bc.expectedCount; } Bowl currentBowl = GameObject.FindGameObjectWithTag("Bowl").GetComponent <Bowl>(); totalProgressCount += currentBowl.expectedProgress; float maxScore = totalProgressCount * correctNoodleValue; float firstGradeMistake = maxScore * (mistake / 100); float threeStars = maxScore - firstGradeMistake; float twoStars = maxScore - firstGradeMistake * 2; float oneStars = maxScore - firstGradeMistake * 3; if (score <= maxScore && score >= threeStars) { starsPerLvl = 3; allStarsEffect.Play(); } else if (score >= twoStars && score <= threeStars) { starsPerLvl = 2; } else if (score >= oneStars && score <= twoStars) { starsPerLvl = 1; } else if (score <= oneStars) { starsPerLvl = 0; } }