i created five scenes in my project, all those five has its own score, all i wanted to do is to calculate the scores form scene 1 to 5. Your answer would mean a lot. Thank you
For that you need to make a static class not derived from MonoBehaviour.
using System;
using System.Collections;
public static Scores
{
public static int score1;
public static int score2;
public static int score3;
public static int score4;
public static score5;
}
Now save the score in these variables from different scenes for eg.
Scores.score1 = 1000; //In Scene1 class
Scores.score2 = 2000; //in Scene2 class
Scores.score3 = 1000; //in Scene3 class
Scores.score4 = 2000; //in Scene4 class
Scores.score5 = 1000; //in Scene5 class
if you want to calculate the sum of all, then you can calculate by
int sum = Scores.score1+Scores.score2+Scores.score3+Scores.score4+Scores.score5;