- Home /
Question by
onyhik · Dec 06, 2016 at 07:03 AM ·
load scene
how to load a scene using score
hay guys, i'm biginner in unity, Could you tell me how to load a scene using the parameter score in untiy 2d (c#), example :
if score 500 until 1000 {loadscene (1) } if score >1000 {loadscene(2)} else score <500 {loadscene(0)}
thanks :)
Comment
Answer by akisrn · Dec 07, 2016 at 03:20 AM
int score; //store score here
void LoadLevel () //call this function in a button or something
{
if (score >= 500 && score <= 1000)
{
Application.LoadLevel("Scene1");
}
else if (score <= 499)
{
Application.LoadLevel("Scene2");
}
else if (score > 1001)
{
Application.LoadLevel("Scene3");
}
}
If this has helped you, please select my answer as the solution to the question. Thanks!