Answer the question
In order to leave comments, you need to log in
Optimizing a bunch of if?
string puk = SceneManager.GetActiveScene().name;
if (puk == "Level1")
levelNum = 1;
if (puk == "Level2")
levelNum = 2;
if (puk == "Level3")
levelNum = 3;
if (puk == "Level4")
levelNum = 4;
if (puk == "Level5")
levelNum = 5;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question