How to combine two percentage scores from different scenes?

Question

I’m working on a quiz game that score is in percent. I am trying to combine two scenes scores into one percent but cannot get them to add correctly. The first scene uses this code for scoring:

// Score percent
public void SetScore()
{
if (FundamentalsTwototalQuestions > 0)
{

FundamentalsTwoscorePerc = (FundamentalsTwoTotalCorrect / FundamentalsTwototalQuestions) * 100; FundamentalsscoreObj.GetComponent().text = “Score: ” + Mathf.Round(FundamentalsTwoscorePerc) + ” %”;

}

The second scene uses this code for scoring:

// Score percent
public void SetScore()
{
CombineQuestions = (FundamentalstotalQuestions + AnsweredQuestions);
CombineScore = (Newscore + FundamentalsscorePerc) / 2;
FundamentalsscoreObj.GetComponent().text = “Score: ” + Mathf.Round(CombineScore) + ” %”;

if (FundamentalstotalQuestions > 0)
{

FundamentalsscorePerc = (FundamentalstotalCorrect / CombineQuestions) * 100;

}

0
ultimate 3 months 0 Answers 64 views 0

About ultimate


Follow Me

Leave an answer