Event when the scene is loaded

I have an object that is not destroyed when loading new level.
I need to be at each load level executed block of code, I’ve seen lots of solutions but everything seems to be outdated.
Earlier I used (see. Code block), but now it does not work.

if(Application.loadedLevelName != "Menu"){
	//Hide loading screen, in menu do it in different script.
}

can anyone advise me how to do it ?

ps. I apologize for any errors in the text, Czech, I am not very good in English

What version of Unity are you using ? If it’s below 5.4, you need to use MonoBehaviour.OnLevelWasLoaded. If it’s 5.4 or above, you’re looking for SceneManager.sceneLoaded.

Here is a detailed answer explaining how to use the sceneLoaded event.