So I've decided to split my game into separate scenes(main menu, gameover, etc.) And I'm trying to use an if statement in my code to check if the current scene is "gameover" so I can perform some action. I know Unity now uses SceneManager instead of Application, but what's the equivalent of this function
if(Application.loadedLevelName == "gameover")
I've tried SceneManager.GetActiveScene == "gameover"
But I just get errors like can't use == here.
I have imported SceneManager aswell
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…